ImageGear for C and C++ on Windows v19.10 - Updated
IG_fltr_savelist_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_savelist_get

This function prepares the list of constants corresponding to format and compression combinations available for saving of the specified image. This is an obsolete function, see remarks.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_fltr_savelist_get(
   LPAT_DIB lpDIB,
   LPAT_MODE lpnFilterList,
   UINT nFListSize,
   LPAT_LMODE lpSaveList,
   UINT nSListSize,
   LPUINT lpnSListCount
);

Arguments:

Name Type Description
lpDIB LPAT_DIB Pointer to the AT_DIB structure that contains the image parameters. If the value is not NULL, this function returns the list of enumIGSaveFormats values corresponding to saving formats (format and compression combinations) available for saving of the specified image. If the value is NULL, then the function returns the list of all currently supported saving formats for file formats specified by lpnFilterList. If both the lpDIB and lpnFilterList are null, the function returns the list of all currently supported saving formats.
lpnFilterList LPAT_MODE Pointer to the list of format identifiers, which will be used in the save list. See enumIGFormats for possible values. If this parameter is NULL, then all currently supported formats will be used.
nFListSize UINT Array containing the number of elements if lpnFilterList is not NULL.
lpSaveList LPAT_LMODE Array containing the returned saving format constants. You can set this value to NULL if you only need to obtain the total number of found saving formats.
nSListSize UINT Size of the lpSaveList array.
lpnSListCount LPUINT If the lpSaveList array is not NULL, this parameter returns the number of copied enumIGSaveFormats values. If lpSaveList is NULL, this parameter returns the total number of records.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

Sample:

None

Example:

 
Copy Code
AT_ERRCOUNT nErrCount;  // Number of errors on stack
HIGEAR hIGear;          // Handle of image
UINT nCount;            // Number of save formats
LPAT_LMODE lpSaveList;

// Load the image
nErrCount = IG_load_file("picture.tif", &hIGear);
if( nErrCount == 0 ) 
{
    AT_DIB atDib;
    AT_DIMENSION nWidth, nHeight;
    UINT nBitsPerPixel;
    // Get image info
    nErrCount = IG_image_dimensions_get(hIGear, &nWidth, &nHeight, &nBitsPerPixel);
    // Fill in AT_DIB structure
    memset(&atDib, 0, sizeof(AT_DIB));
    atDib.biSize = sizeof(AT_DIB);
    atDib.biWidth = nWidth;
    atDib.biHeight = nHeight;
    atDib.biPlanes = 1;
    atDib.biBitCount = nBitsPerPixel;
    
    // Get save formats count 
    nErrCount = IG_fltr_savelist_get(&atDib, NULL, 0, NULL, 0, &nCount);
    // Allocate memory
    lpSaveList = (LPAT_LMODE)malloc( nCount*sizeof(AT_LMODE) );
    if( lpSaveList!=NULL )
    {
        // Get save list
        nErrCount = IG_fltr_savelist_get(&atDib, NULL, 0, lpSaveList, nCount, NULL);
        
        //...

        // Delete memory
        free(lpSaveList);
    }
    // Delete the image
    IG_image_delete(hIGear);
}

Remarks:

This function is only kept for backward compatibility reasons. Please use IG_fltr_savelist_get_ex instead.

Records returned by the function are sorted alphabetically by their short names. Short names correspond to those returned by IG_fltr_info_get function.

This function works similarly to IG_fltr_compressionlist_get, but it works with all formats supported by ImageGear rather than with a particular format. Values returned in the lpSaveList can be passed directly to ImageGear saving functions such as IG_fltr_save_file.

See also the section Saving.