ImageGear Professional DLL v17.1 for Windows Accusoft
IG_fltr_compressionlist_get_ex
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_compressionlist_get_ex

Glossary Item Box

This function returns the list of compressions available for saving the specified image to a particular file format.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_fltr_compressionlist_get_ex(
   const HIGDIBINFO hDIB,
   AT_MODE nFormatID,
   LPAT_MODE lpComprList,
   UINT nCListSize,
   LPUINT lpnCListCount
);

Arguments:

hDIB Handle of DIB info object that contains image parameters. If NULL, then this function returns all possible compressions.
nFormatID File format identifier. See enumIGFormats for possible values.
lpComprList Pointer to the array to return the list of compression constants to. See enumIGCompressions for possible values. Set to NULL if you only need to obtain the number of available compressions.
nCListSize Size of the lpCompList array.
lpnCListCount Pointer to a variable which will receive the actual number of compression constants.

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 ImageGearProfessional.

Sample:

See GUI component source code.

Example:

  Copy Code
AT_ERRCOUNT nErrCount;  // Number of errors on stack
HIGEAR hIGear;          // Handle of image
HIGDIBINFO hDIB;        // DIB info handle of image
UINT nCount, nActual;   // Number of compressions
LPAT_MODE lpCompList;   // List of compressions

// Load the image
nErrCount = IG_load_file("picture.tif", &hIGear);
if( nErrCount==0 ) 
{
    nErrCount = IG_image_DIB_info_get(hIGear, &hDIB);
    // Get compression count 
    nErrCount = IG_fltr_compressionlist_get_ex(hDIB, 
        IG_FORMAT_TIF, NULL, 0, &nCount);
    // Allocate memory for compressions
    lpCompList = (LPAT_MODE) malloc(nCount * sizeof(AT_MODE));
    // Get list of compressions that can be used when  
    // saving the given image into TIFF format
    nErrCount = IG_fltr_compressionlist_get_ex(hDIB, 
        IG_FORMAT_TIF, lpCompList, nCount, &nActual);

    // ...

    // Delete memory
    free(lpCompList);
    // Delete DIB info
    IG_DIB_info_delete(hDIB);
    // Delete the image
    IG_image_delete(hIGear);
}

Remarks:

See also the section Using Format Filters API for Image Saving.

©2012. Accusoft Corporation. All Rights Reserved.