This function loads an image from a memory buffer using user-defined callback functions.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_load_mem_CB( LPVOID lpImage, AT_UINT nSize, UINT nPage, UINT nTile, LPFNIG_RASTER_SET lpfnRasterSet, LPFNIG_DIB_CREATE lpfnDIBCreate, LPVOID lpPrivateData ); |
Arguments:
lpImage | Pointer to a memory buffer containing the image. |
nSize | Size of image in memory. |
nPage | Page number to load if this is a multi-page file. Note that page numbers begin at 1, not 0. Set nPage to 1 if this is not a multi-page file. |
nTile | If loading an image that is tiled, you can set the number of a specific tile to load. Set to 1 for a non-tiled image. |
lpfnRasterSet | Pointer to callback function to be called after each raster line is read. See LPFNIG_RASTER_SET. |
lpfnDIBCreate | Pointer to callback function to be called after the file header has been read. See LPFNIG_DIB_CREATE. |
lpPrivateData | Pointer to a private data area. This pointer will be passed to the callback functions. |
Return Value:
Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.Supported Raster Image Formats:
- Indexed RGB - 1, 4, 8 bpp;
- Grayscale - 9...16 bpp;
- RGB - 24 bpp;
- CMYK - 32 bpp.
Actual set of pixel formats supported by this function can be narrower, depending on the implementation of the user-defined callback functions. |
Sample:
None
Remarks:
This function is only kept for backward compatibility reasons. Please use IG_load_mem_CB_ex instead. |
See the description under function IG_load_FD_CB. See also function IG_load_mem.
If you set nPage to < 1, ImageGear will default the value to 1; if you set nPage to greater than the number of pages in the document, ImageGear will default the value to the last page number. This same default procedure applies to the nTileNum parameter as well. |