Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image manipulation
#2
Function LoadImageAnyFormat
Code:
Copy      Help
;/
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)