ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_formatlist_sort

This function sorts the array of file format constants in alphabetic order based on the short format names.


Copy Code
AT_ERRCOUNT ACCUAPI IG_fltr_formatlist_sort(
   LPAT_MODE lpFormatList,
   UINT nFListSize


Name Type Description
lpFormatList LPAT_MODE Array of file format constants. See enumIGFormats for possible values.
nFListSize UINT Size of lpFormatList array.

Return Value:

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

Supported Raster Image Formats:

This function does not process image pixels.


Copy Code
AT_ERRCOUNT nErrCount;    // Count of errs on stack upon ret from func
UINT nCount;            // Count of supported formats
LPAT_MODE lpFormatList; // list of formats
// Get list filters that support detect and saving:
// Get total count
    0, &nCount );
if( nErrCount==0 ) 
    // Allocate memory
    lpFormatList = (LPAT_MODE)malloc( nCount*sizeof(AT_MODE) );
    if( lpFormatList!=NULL )
        // Get supported formats
            lpFormatList, nCount, NULL );
        // Sort formats in alphabetic order */
        IG_fltr_formatlist_sort( lpFormatList, nCount );

        // ...

        // Delete memory
        free( lpFormatList );


You can use this function to sort the list of formats obtained from IG_fltr_formatlist_get. Short file format names used for sorting correspond to short names returned by IG_fltr_info_get function.

See also the section Loading and Saving.

Is this page helpful?
Yes No
Thanks for your feedback.