ImageGear for C and C++ on Linux - Updated
IG_save_mem_CB
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Save Functions > IG_save_mem_CB

This function saves the image referenced by hIGear to a memory buffer using user-defined callback functions.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_save_mem_CB(
   LPVOID lpImage,
   AT_UINT nImageSize,
   AT_UINT nBufferSize,
   UINT nPage,
   UINT nReserved,
   AT_LMODE lFormatType,
   LPFNIG_RASTER_GET lpfnRasterGet,
   LPFNIG_DIB_GET lpfnDIBGet,
   LPVOID lpPrivateData,
   LPAT_UINT lpActualSize
);

Arguments:

Name Type Description
lpImage LPVOID Memory buffer to which to save the image.
nImageSize AT_UINT Size of the image if it already exists in the buffer, 0 otherwise.
nBufferSize AT_UINT Size of the memory buffer.
nPage UINT If saving to a multi-page file, set this to the page number to insert this page as. Note that page numbers begin at 1, not 0. Otherwise set to 1.
nReserved UINT Reserved, should be set to 0 for now.
lFormatType AT_LMODE Specifies the format to use for saving, and also the compression scheme if applicable. See enumIGSaveFormats.
lpfnRasterGet LPFNIG_RASTER_GET Pointer to a function of type LPFNIG_RASTER_GET, which will be called for each raster line of the image, before that line is saved.
lpfnDIBGet LPFNIG_DIB_GET Pointer to a function of type LPFNIG_DIB_GET, which will be called just prior to saving the DIB header.
lpPrivateData LPVOID Pointer to a private data area which is passed to the above two callback functions each time they are called.
lpActualSize LPAT_UINT Actual size of the image is returned in the variable referenced by this pointer. Can be NULL.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

Actual set of pixel formats supported by this function can be narrower, depending on the implementation of the user-defined callback functions.

Remarks:

This function is only kept for backward compatibility reasons. Please use IG_save_mem_CB_ex instead.