04-14-2006, 09:40 PM
Function LoadImageAnyFormat
See also in QM help:
LoadPictureFile
SaveBitmap
;/
function# $_file
;Loads image of bmp, gif, jpg or other supported type.
;Returns bitmap handle. Later you must free it with DeleteObject.
typelib GflAx {059321F1-207A-47A7-93A1-29CDF876FDD3} 1.0 1
dll user32 #CopyImage handle un1 n1 n2 un2
str s.searchpath(_file)
if(!s.len) end "file does not exist"
if(s.endi(".bmp")) ret LoadImage(0 s IMAGE_BITMAP 0 0 LR_LOADFROMFILE)
GflAx.GflAx g._create
g.EnableLZW=TRUE ;;needed for gif
g.LoadBitmap(s)
stdole.IPicture p=g.GetPicture
ret CopyImage(p.Handle IMAGE_BITMAP g.width g.height 0)
See also in QM help:
LoadPictureFile
SaveBitmap