This function is called by ImageGear to obtain from your application each raster to be saved.
Declaration:
Copy Code | |
---|---|
typedef AT_ERRCOUNT (ACCUAPI LPFNIG_RASTER_GET) ( LPVOID lpPrivate, LPAT_PIXEL lpRast, AT_PIXPOS cyPos, DWORD cRasterSize ); |
Arguments:
Name | Type | Description |
lpPrivate | LPVOID | Far pointer to private data area. |
lpRast | LPAT_PIXEL | Far pointer to first byte of raster your function is providing. |
cyPos | AT_PIXPOS | The raster's Y position in the image (0 = top line of image). |
dwRasterSize | DWORD | Number of bytes in the raster. |
Return Value:
Return an error count.
Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Load Callback
Example:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI MyRasterGet (LPVOID lpPrivate, LPAT_PIXEL lpRast, AT_PIXPOS lYpos, DWORD dwBytes ){ /* Provide raster row lYpos, by storing it where LPAT_PIXEL points. Should be exactly dwBytes, counting padding. */ ... return IG_error_check(); } |
Remarks:
This is one of the two types of callback function supplied in calls to IG_save_FD_CB_ex() or IG_save_mem_CB_ex() functions. The line's position in the image is identified by cyPos. The lines may not be in order.
lpRast is a pointer to the start of your raster, and dwRasterSize is the number of bytes in the line. ImageGear will compress the line for you as it saves it, according to the compression scheme specified in your original call to save the image. lpPrivate points to the private data area supplied in that call.
You should check the ImageGear error count (AT_ERRCOUNT) after each raster is read. If you need to terminate the load, you can place an error on the stack yourself, using IG_error_set(). See the description for that function. |