ImageGear for C and C++ on Linux v18.8 - Updated
IG_save_file
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Save Functions > IG_save_file

This function will store the image rectangle of the image referenced by hIGear to disk using the name lpszFilename.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_save_file(
   HIGEAR hIGear,
   const LPSTR lpszFileName,
   AT_LMODE lFormatType
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image to save.
lpszFileName const LPSTR Pointer to the filename (you may include path with filename) in which to save.
lFormatType AT_MODE Specifies the format to use for saving, and also the compression scheme if applicable. See enumIGSaveFormats.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

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 to save to, set lFormatType = IG_SAVE_UNKNOWN.

When an image is saved to a multi-page file format (for example, TIFF or DCX), if the file already exists then the new image is appended as a new page in the file. When an image is saved to a non-multi-page file format, if the file already exists it is simply overwritten; the previous version of the file is lost.

IG_fltr_save_file is an extended version of this function. It allows inserting or replacing pages in multi-page files.

Some file formats, such as TXT, JPEG, and others, may be saved with additional control, using IG_fltr_ctrl_get and IG_fltr_ctrl_set. See the description also in the section Loading and Saving.