Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog_loadImage
#4
Member function GdipBitmap.FromMemory
Code:
Copy      Help
function'GDIP.GpBitmap* str&imageFileData

;Creates this bitmap from image data (image file in memory).
;Supported formats: BMP, GIF, JPEG, PNG, TIFF, ICON, WMF, EMF, EXIF.


if(!GdipInit) ret
Delete

__Stream x.CreateOnHglobal(imageFileData imageFileData.len); err end _error
_hresult=GDIP.GdipCreateBitmapFromStream(x +&m_i)
ret +m_i
Function GdipLoadPictureFileFromMemory
Code:
Copy      Help
;/
function# str&imageFileData [backColor] [flags] ;;backColor: 0xAARRGGBB or ColorARGB(red green blue alpha).  flags: 1 DDB

;Loads image data (image file in memory) and returns GDI bitmap handle.
;Returns 0 if failed.
;If the image has transparent areas, uses backColor as background color. Alpha remains.
;The returned bitmap later must be deleted with DeleteObject. Or assign to a __GdiHandle variable, it calls DeleteObject automatically.
;Supports all GDI+ formats: BMP, GIF, JPEG, PNG, TIFF, ICON, WMF, EMF, EXIF.


#compile "__Gdip"
GdipBitmap b
if(!b.FromMemory(imageFileData)) ret
ret b.GetHBITMAP(backColor flags)

GDI+
GDI+


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)