在pb中用SetPicture(lb_image)当lb_image为空时picture的图片不变

pyh123 2002-04-03 02:30:30
我想在每选一行时picture都变为与该行相关的图片,当数据库中还没有图片数据时
picture不显示任何图片,现在的问题是当没有图片时picture显示上一次的图片
我是这样写的,由于不知道图像的格式不能用p_1.picturename = ...
SQLCA.AutoCommit = True
SelectBlob images Into :lbld_image
From tc_clrimage
Where clr = :ls_currclr;
SQLCA.AutoCommit = False
lbld_image = Blob('') //or SetNull(lbld_image)


p_image.SetPicture(lbld_image)
...全文
181 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinalht 2002-04-08
  • 打赏
  • 举报
回复
if isnull( lb_image ) then
p_image.picturename = ''
return
end if
if len( lb_image ) < 256 then
p_image.picturename = ''
return
end if
p_image.setpicture( lb_image )
那个256可以自己在根据实际情况改一下
pyh123 2002-04-08
  • 打赏
  • 举报
回复
你的做法我试过,不行
jiazhij 2002-04-03
  • 打赏
  • 举报
回复
不可以混着用吗?
SQLCA.AutoCommit = True
SelectBlob images Into :lbld_image
From tc_clrimage
Where clr = :ls_currclr;
SQLCA.AutoCommit = False
lbld_image = Blob('') //or SetNull(lbld_image)
if isnull(lb_image) then
p_image.picturename=''
else
p_image.SetPicture(lbld_image)
end if

jiazhij 2002-04-03
  • 打赏
  • 举报
回复
不可以混着用吗?
SQLCA.AutoCommit = True
SelectBlob images Into :lbld_image
From tc_clrimage
Where clr = :ls_currclr;
SQLCA.AutoCommit = False
lbld_image = Blob('') //or SetNull(lbld_image)
if isnull(lb_image) then
p_image.picturename=''
else
p_image.SetPicture(lbld_image)
end if

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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