当前位置: 代码迷 >> PB >> bmp2jpg 转换后图片分裂,该怎么处理
  详细解决方案

bmp2jpg 转换后图片分裂,该怎么处理

热度:182   发布时间:2016-04-29 10:27:31.0
bmp2jpg 转换后图片分裂

如图 刚用的时候还是好的 

代码如下:

string filename,ls_target
ulong hwdc
blob lbl_file,lbl_temp
long li_filenum,li_temp,ll_len,ll_byte,i,int_filehandle
string ls_path,str_filename,ls_inf
Blob lblb_bitmap
string ls_curdir
ulong l_buf
l_buf=100
ls_curdir=space(l_buf)
GetCurrentDirectoryA(l_buf,ls_curdir)
//gs_pic_path
filename = ls_curdir + "\" + string(datetime(today(),now()),"yyyymmddhhmmss") + ".bmp"
ls_target = ls_curdir + "\" + string(datetime(today(),now()),"yyyymmddhhmmss") + ".jpg"
if lhand > 0 then
  lblb_bitmap = in_bitmap.of_ControlCapture(p_2, False)
  in_bitmap.of_WriteBlob(filename, lblb_bitmap)//截取照片


bmp2jpg(filename,ls_target,90,0) p_1.PictureName=ls_target//filename 
ls_path=ls_target//filename

ll_len=filelength(ls_path)
li_filenum = FileOpen(ls_path, StreamMode!)
IF li_filenum = -1 THEN
ls_inf = guo_message.of_get_information('005')
messagebox(title, ls_inf )
//messagebox('提示信息', '打开文件失败!', StopSign!)
RETURN
END IF


ll_byte = 32765
li_temp = integer(ll_len/ll_byte)
IF mod(ll_len, ll_byte) > 0 THEN li_temp +=1
 
FOR i = 1 TO li_temp
 fileread(li_filenum, lbl_temp)
 lbl_file += lbl_temp
NEXT
//file://关闭文件
fileclose(li_filenum)
ibl_file = lbl_file

p_1.setpicture(ibl_file)
tab_message.tabpage_1.cb_ok.enabled = true
//p_1.setpicture(filename)
  tab_message.tabpage_1.cb_ok.enabled = true
FileDelete(filename)
//FileDelete(ls_target)
end if

------解决方案--------------------
是这个dll本身的问题