CreateImageFromMemory Method

See Also     Examples     Applies To

Creates a new GdPicture Image from from a file stored in memory.

Syntax

object.CreateImageFromMemory (hMem, Length)

The CreateImageFromMemory syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
hMem Required. Long. The memory handle where the file is stored.
Length Required. Long. The length of the memory data in byte.

Returns

Long.
0: The image could not created. Use the GetStat() function to determine the reason this function failed.
Non-zero: GdPicture Image handle. Handle of the created image.

Remarks

If success, set the created image as the native GdPicture image.
Supported formats are BMP, DIB, RLE, ICO, EMF, WMF, GIF, ANIMATED GIF, JPEG, JPG, JPE, JFIF, PNG, TIFF, MULTIPAGE TIFF, PNM, PPM, PBM, PFM, PGM, RPPM, RPGM, RPBM, PCX.
Redistributing the optional gdimgplug.dll library you will also be able to read XPM, XBM, WBMP, TGA, SGI, RAW, PICT, Sun RAS, PSD, MNG, Kodak PhotoCD files, KOALA files, JP2, J2K, JNG, JBIG, IFF, HDR, Raw Fax G3, EXR, DDS and Dr. Halo files.

Note for multipage images (TIFF and GIF):
By default, the class loads multipage images (GIF and TIFF) for reading and writing creating a GdPicture image marked as editable multipage.
However this way is a bit slower than creating a GdPicture image marked as non editable multipage.
If you want to open multipage images as read only, you should call the TiffOpenMultiPageAsReadOnly() function for tiff files or the GifOpenMultiPageAsReadOnly() function for gif files.

Category

Load, Import & Create an image





© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.