This function stores the image referenced by hIGear to a file.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_fltr_save_file(
HIGEAR hIGear,
const LPSTR lpszFileName,
AT_LMODE lFormatType,
UINT nPageNumber,
AT_BOOL bOverwrite
);
|
Arguments:
hIGear | HIGEAR handle of the image to save. |
lpszFileName | Path and name of the file to save the image to. The path can be absolute or relative. |
lFormatType | Specifies the format to use for saving, and also the compression scheme if applicable. See enumIGSaveFormats for possible values. |
nPageNumber | 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 | 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. |
Return Value:
Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Color, Display, Img_proc.
Example:
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); } |
Remarks:
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. |