04-05-2013, 05:47 AM
Member function GdipBitmap.FromMemory
Function GdipLoadPictureFileFromMemory
GDI+
GDI+
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# 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+