HPDFPRINT IMAGE Image cannot be loaded

Moderator: Rathinagiri

franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: HPDFPRINT IMAGE Image cannot be loaded

Post by franco »

Thanks edk,
I will try this and see how it works. I Have the following working and works very well, but I am opening a file which I don`t like.

BT_BitmapSaveFile ( ( hBitmap:=BT_BitmapLoadFile ("test.bmp") ) , "test.jpg", BT_FILEFORMAT_PNG )
BT_BitmapRelease (hBitmap) // is sent from hmg print /\ is bitmap /\ name of file /\becomes png file.


In print procedure I use before printiong image.
checkpng() //opens file and checks for PNG at start of file. All png files have this.
if png = .T.
print image ? type png
else
print image ? type jpg
endif
png := .F.


function checkpng
local pho
f:=fopen(pimage,0) // pimage is my picture file // 0 read only
if f>-1 //no error
pho :=(FREADstr(f, 10))
fclose(f)
if 'PNG' $ upper(pho)
png := .T.
else
png := .F.
endif
fclose(f)
endif

fclose(f)
return

This could be usefull for someone else.
All The Best,
Franco
Canada
Post Reply