P_1.setpicture()显示图片问题
代码如下:
//filedisk
//fileread
string filepath,filename
string ll_path
int i,f_num,loops,j
long f_long,sum_read,p_new
blob tot_b,b,pic
p_new=0
i=getfileopenname('请选择图片',filepath,filename,"all Files (*.jpg),*.bmp,*.jpg");
sle_path.text=filepath
f_long=filelength(trim(sle_path.text))
f_num=fileopen(trim(sle_path.text),STREAMMODE!,READ!,LOCKREAD!)
//以每次读取32K为基础,决定读取几次
if f_long>32765 then
if mod(f_long,32765)=0 then
loops=f_long/32765
else
loops=f_long/32765+1
end if
else
loops=1
end if
//循环读取
for i=1 to loops
sum_read=fileread(f_num,b)
tot_b=tot_b+b
p_new=p_new+sum_read
fileseek(f_num,p_new, FROMBEGINNING!)
next
fileclose(f_num)
p_1.visible=true
SetPicture(p_1,tot_b)
sqlca.autocommit=true
select count(*) into :j from s_orgcode_pic
where orgcode=:ll_depot;
if j=0 or isnull(j) then
insert into s_orgcode_pic(orgcode,pic ,createtime )
values (:ll_depot,:tot_b,getdate());
end if
if sqlca.sqlcode<>0 then
messagebox("提示","生成数据失败"+SQLCA.SQLErrText)
return 1
end if
updateblob s_orgcode_pic set pic=:tot_b
where orgcode=::ll_depot;
sqlca.autocommit=false
selectblob pic into :pic
from s_orgcode_pic where orgcode=:ll_depot;
//p_1.SetPicture(pic)
数据库表create table s_orgcode_pic
(orgcode varchar(12),
pic image null ,
createtime datetime)
执行完,在数据库中有数据,就是用selectblob后无法显示图片.
我把SetPicture(p_1,tot_b) 放在数据库存储前执行是能够显示的.放到selectblob就不可以?
有达人能帮我看看吗?
相关推荐
PB中保存图片,PB中存取图片
PB中保存图片,PB中保存图片,PB中保存图片,PB中保存图片
PB中保存图片.doc
PB中保存图片.docPB中保存图片.doc
PB8中如何保存图片
nteger li_file,li_ret,loops,i string ls_file,ls_path blob lb_small long flen,bytes_read,new_pos //search the file li_ret = getfileopenname("选择图片文件",ls_path,ls_file, &"BMP","图片文件(*.BMP),*.BMP") if li_ret = 1 then
pb10编码解码base64
pb10调用base64.dll,实现将图片转换成base64编码,将base64编码转换成图片 函数声明 function long GetFileEncode64(ref string filename, ref string encode64)library "base64" alias for "GetFileEncode64;Ansi" function long Base64Decode(ref blob ouput, ref string input ,long inputlen)library "base64" alias for "Base64Decode;Ansi" 调用实例 string ls_filename,ls_ret long num blob lb_file blob{10000000} lb_ret//初始化足够大的空间, ls_filename="K:\\照片0034_001_001.jpg"//要编码的图片完整路径名 ls_ret=space(10000000)//初始化足够大的空间接受返回的编码 num=GetFileEncode64(ls_filename, ls_ret)//base64编码 ls_ret=trim(ls_ret) //-------解码---通过blob类型变量接收,一定要初始化足够空间大小 num=len(ls_ret) num=Base64Decode(lb_ret, ls_ret,num)//解码 p_1.setpicture(lb_ret)//图片控件中显示
2026年电动汽车高压继电器行业分析:预计到2032年收入规模将接近 15082.78 百万美元.pdf
2026年电动汽车高压继电器行业分析:预计到2032年收入规模将接近 15082.78 百万美元.pdf


数据库相关
