ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_save_file |
This function stores the image referenced by hIGear to a file.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_fltr_save_file(
HIGEAR hIGear,
const LPSTR lpszFileName,
AT_LMODE lFormatType,
UINT nPageNumber,
AT_BOOL bOverwrite
);
|
Name | Type | Description |
hIGear | HIGEAR | HIGEAR handle of the image to save. |
lpszFileName | const LPSTR | Path and name of the file to save the image to. The path can be absolute or relative. |
lFormatType | AT_LMODE | Specifies the format to use for saving, and also the compression scheme if applicable. See enumIGSaveFormats for possible values. |
nPageNumber | UINT | Specifies the page number of the page inserted into a multi-page file. Note that page numbers begin at 1, not 0. Set to 0 to append the page after the last page of the source file. Set to 1 if the file format does not support multipage, or if saving to a new file. |
bOverwrite | AT_BOOL | Set to TRUE to overwrite existing file during the saving. Set to FALSE to insert or append the page to the file, if the format supports multipage saving. |
All pixel formats supported by ImageGear Professional.
Color, Display, Image Processing
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; // Count of returned errors on stack HIGEAR hIGear; //ImageGear handle nErrcount = IG_load_file("picture.tif", &hIGear); if(nErrcount == 0) { // Save image to file "picture.bmp" in BMP format without compression: nErrcount = IG_fltr_save_file(hIGear, "picture_new.tif", IG_SAVE_TIF_UNCOMP, 1, TRUE); IG_image_delete(hIGear); } |
lFormatType is used to set the format and compression (if applicable) of the output file. If you want to have ImageGear use the file extension provided in your filename string (lpszFilename) to determine the file format in which to save the file, set lFormatType = IG_SAVE_UNKNOWN.
See also the section Using Format Filters API for Image Saving. |