//不超过32K
//blob aa
//integer i
//i=fileopen('d:\dd\b.bmp',streammode!)
////文件长度不能超过32765字节
//if i<> -1 then
// fileread(i,aa)
// fileclose(i)
// p_1.setpicture(aa)
//end if
//超过32K
blob aa,lbb_bmp,lbb_tmp
integer li_filenum,li_loopnum,li_loop
long ll_flength
string str_bmpname
str_bmpname='d:\dd\b.bmp'
ll_flength = FileLength(str_bmpname)
if IsNull(ll_flength) then ll_flength = -1
if ll_flength < 0 then
Messagebox("错误信息", "图文件不存在!", Exclamation!)
return
end if
//打开文件
li_FileNum = FileOpen(str_bmpname, StreamMode!, Read!)
if li_FileNum < 0 then
FileClose(li_FileNum)
Messagebox("错误信息", "打开图文件 " + str_bmpname + " 失败!", Exclamation!)
return
end if
//读文件数据 ,大于32K要多次循环取
li_loopnum = ll_flength / 32765 + 1
for li_loop = 1 to li_loopnum
FileRead(li_FileNum, lbb_tmp)
lbb_bmp = lbb_bmp + lbb_tmp
next
p_1.setpicture(lbb_bmp)
FileClose(li_FileNum)