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. |
This function does not process image pixels.
See GUI component source code.
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 nErrCount = IG_fltr_formatlist_get(IG_FLTR_DETECTSUPPORT|IG_FLTR_PAGEINSERTSUPPORT, NULL, 0, &nCount ); if( nErrCount==0 ) { // Allocate memory lpFormatList = (LPAT_MODE)malloc( nCount*sizeof(AT_MODE) ); if( lpFormatList!=NULL ) { // Get supported formats IG_fltr_formatlist_get(IG_FLTR_DETECTSUPPORT|IG_FLTR_PAGEINSERTSUPPORT, 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.