LPFNIG_BATCH_BEFORE_SAVE is called before an image file is saved, allowing you to correct and image before saving.
Copy Code
|
|
---|---|
typedef AT_BOOL (LPACCUAPI LPFNIG_BATCH_BEFORE_SAVE)( LPVOID lpPrivate, HIGEAR hIGear, UINT nPageNumber ); |
Name | Type | Description |
---|---|---|
lpPrivate | LPVOID | Far pointer to private data area. |
hIGear | HIGEAR | HIGEAR handle to the image. |
nPageNumber | UINT | This variable is set to the number of pages to be saved. |
Reserved (must always be TRUE).
All pixel formats supported by ImageGear for C and C++.
None
Copy Code
|
|
---|---|
// DLL // User's BatchBeforeSave CB AT_BOOL MyBatchBeforeSave( LPVOID lpPrivate, /* Private data passed in */ HIGEAR hIGear, /* ImageGear image handle */ UINT nPageNumber /* Number of page to be saved */ ) { // Convert bpp to 1 before saving UINT bits_per_pixel; IG_image_dimensions_get(hIGear, NULL, NULL, & bits_per_pixel); If(bits_per_pixel != 1) { IG_IP_color_reduce_bayer(hIGear, 1, NULL); } return TRUE; } // Register BatchBeforeSave CB IG_batch_CB_register(MyBatchBeforeSave, IG_BATCHCB_BEFORE_SAVE, this); |
For example, you might want to rotate an image before saving.
Multipage documents can be saved as a set of different files if the flag IG_BATCH_MP_TO_MP is not specified.