PB 图片用datawindow中的图片控件设置filename后不显示出来,源码测试可行 5C

int li_FileNum,n,i,ret,li_row
long start,ll_r
Blob emp_id_pic,temp
boolean lb_rtn

dw_2.reset()

IF ISNULL(Row) THEN Row = 0
IF Row = 0 THEN RETURN

ls_file = GetCurrentDirectory( )+ "\tsyl.bmp"
lb_rtn = FileDelete(ls_file)

ls_brgl = dw_1.object.brgl[row]
SELECTBLOB ZPZL INTO :emp_id_pic FROM photo WHERE BRGL = :ls_brgl USING sqlphoto;

li_FileNum = FileOpen(ls_file,streammode!,Write!,LockReadWrite!,Replace!)
IF Li_filenum<0 THEN
messagebox("错误","创建相片文件时发生错误")

RETURN
END IF

n=len(emp_id_pic)/32765+1

for i=1 to n
start=(i - 1)*32765+1

temp=blobmid(emp_id_pic,start,32765)

if isnull(temp) or temp=blob('') then

exit

end if
ret=FileWrite(Li_FileNum,temp)

IF ret <0 THEN

messagebox("错误","写相片文件时发生错误")

fileclose(Li_FileNum)

return

end if

next

fileclose(Li_FileNum)

IF ISNULL(emp_id_pic) THEN
MESSAGEBOX('提示','该记录没有有效的图片信息!')
RETURN
ELSE
ib_zp = TRUE
END IF
//p_1.SetPicture(Emp_id_pic)
p_img.object.image = ls_file
p_img.object.fitto(0) //最佳适应。
p_img.object.display()

IF UPPER(RIGHT(TRIM(ls_file),3)) = "BMP" OR UPPER(RIGHT(TRIM(ls_file),3)) = "JPG" THEN //本系统用picture只显示bmp和jpg两种
li_row = dw_2.insertrow(0)
dw_2.modify("p_1.filename = '" + ls_file + "'")
dw_2.modify("p_2.filename = '" + ls_file + "'")
dw_2.object.text1[li_row] = is_text
dw_2.object.text2[li_row] = is_text
END IF

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问