ImageGear Professional v18.1 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_save_file_size_calc |
This function is used to determine the size that is required for saving the image to the file in the given format.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_fltr_save_file_size_calc(
HIGEAR hIGear,
const LPSTR reserved_filename,
AT_LMODE lFormatType,
AT_UINT reserved_page,
AT_BOOL reserved_overwrite,
LPAT_UINT lpFileSize
);
|
Name | Type | Description |
hIGear | HIGEAR | HIGEAR handle of the image for which to calculate the size. |
reserved_filename | const LPSTR | Reserved for future use. Set to NULL. |
lFormatType | AT_LMODE | Specifies the format to use for saving, and also the compression scheme if applicable. See enumIGSaveFormats for possible values. |
reserved_page | AT_UINT | Reserved for future use. Set to 0. |
reserved_overwrite | AT_BOOL | Reserved for future use. Set to FALSE. |
lpFileSize | LPAT_UINT | Returns the maximum possible size of the file. |
All pixel formats supported by ImageGear Professional.
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrCount; HIGEAR hIGear = 0; AT_UINT nFileSize; // File size returned; nErrCount = IG_load_file("picture.tif", &hIGear); if(nErrCount == 0) { nErrCount = IG_fltr_save_file_size_calc(hIGear, 0, IG_SAVE_TIF_UNCOMP, 1, TRUE, &nFileSize); IG_image_delete(hIGear); } |
This call may be used prior to calling IG_fltr_save_file to determine the size of result file.
As of this writing, the function can only calculate the size of a single-page file. To calculate the size of a multipage file after addition of a page, load the original file into a memory buffer, and then use IG_fltr_save_mem_size_calc.
See also the section Using Format Filters API for Image Saving.