ImageGear for C and C++ on Windows v19.7 - Updated
LPFNIG_MEM_REALLOC
API Reference Guide > Core Component API Reference > Core Component Callback Functions Reference > LPFNIG_MEM_REALLOC

Create a function of this type to give your application the flexibility of replacing ImageGear's memory reallocation routine with your own.

Declaration:

 
Copy Code
typedef LPBYTE (ACCUAPI LPFNIG_MEM_REALLOC) ( 
        LPBYTE lpBuffer, 
        AT_UINT nSize
);

Arguments:

Name Type Description
lpBuffer LPBYTE Far pointer to the buffer to be reallocated.
nSize AT_UINT New byte count for realloc buffer.

Return Value:

The user supplied callback function should return a pointer to the allocated block of memory.

Supported Raster Image Formats:

This function does not process image pixels.

Sample:

Filters

Example:

 
Copy Code
***********************************************************/
/* Memory ReAlloc callback function definition        */
***********************************************************/
LPBYTE ACCUAPI MyMemReAlloc( LPBYTE lpbuffer, AT_UINT nSize)
{
        /* Put your memory reallocation code here */
        return( lpBuffer);
};
/*See also example for IG_mem_CB_register() */

Remarks:

This callback function is registered by calling IG_mem_CB_register(). The register function must be called prior to any user-defined callback functions being used by the ImageGear library.