关于DW数据窗口里 图片浏览 

满上 2008-12-28 10:40:01
本人新手,请大家帮帮忙
我用SELECTBLOB pic INTO :gb_photo FROM tname where 代码=:ls_id Using SQLCA;
if string(gb_photo)='' or isnull(string(gb_photo)) then
P_1.picturename='no.jpg'
else
P_1.setpicture(gb_photo)
end if
能在窗口里看到图片,不知道在dw里的P_1里怎么浏览图片,谢谢各位了!
...全文
111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Chenghj 2008-12-29
  • 打赏
  • 举报
回复
需要知道图片格式,代码如下:
string path_filename
long i,j,m,li_rc,li_FileNum,flen,loops,new_pos,bytes_read
blob tot_b,b

SELECTBLOB pic INTO :gb_photo FROM tname where 代码=:ls_id Using SQLCA;
if string(gb_photo)='' or isnull(string(gb_photo)) then
P_1.picturename='no.jpg'
else
path_filename = GetCurrentDirectory() + '\aaa.jpg'
filedelete(path_filename)
flen = len(tot_b)
li_FileNum = fileopen(path_filename,StreamMode!, Write!, LockWrite!, append!)
if flen > 32765 then
m = ((flen - 1)/32765) + 1
else
m = 1
end if
if m = 1 then
filewrite(li_FileNum,tot_b)
else
for j = 1 to m
if j < m then
b = blobmid(tot_b,(j - 1)*32765+1,32765)
else
b = blobmid(tot_b,(j - 1)*32765+1,flen)
end if
filewrite(li_FileNum,b)
next
end if
fileclose(li_FileNum)
p_1.visible = false
p_1.PictureName = path_filename
p_1.visible = true
filedelete(path_filename)
end if
jlwei888 2008-12-28
  • 打赏
  • 举报
回复
http://blog.csdn.net/jlwei888/archive/2008/07/09/2627748.aspx

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧