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

This function allows you to get full information about a control parameter supported by an ImageGear filter. It also returns the current or default value of the parameter.

Declaration:

 
Copy Code
AT_ERRCODE ACCUAPI IG_fltr_ctrl_get(
   DWORD dwFormatID,
   const LPCHAR lpcsCtrlName,
   AT_BOOL bGetDefault,
   LPAT_MODE lpnValueType,
   LPDWORD lpdwValueSize,
   LPVOID lpBuffer,
   DWORD dwBufferSize
);

Arguments:

Name Type Description
dwFormatID DWORD A constant indicating the format filter for which the information should be retrived. See enumIGFormats for possible values.
lpcsCtrlName const LPCHAR Specifies the name of the control parameter you want to get the info about. Use IG_fltr_ctrl_list to obtain the names of control parameters supported for a format filter.
bGetDefault AT_BOOL Set to TRUE to obtain the default value of the control parameter. Set to FALSE to obtain the current value of the control parameter.
lpnValueType LPAT_MODE Returns the value type of control parameter.
lpdwValueSize LPDWORD Returns the size in bytes of the memory buffer that should be allocated for lpBuffer to completely fit the returned value. If NULL then this parameter is ignored.
lpBuffer LPVOID Pointer to a memory buffer which will be overwritten with the control parameter value.
dwBufferSize DWORD The size of memory allocated for lpBuffer pointer. If it is less than the value returned through lpdwValueSize then only dwBufferSize bytes will be written to the lpBuffer, and no error will be returned.

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.

Sample:

ASCII, Flashpix, Medical, and some others.

Example:

 
Copy Code
AT_ERRCOUNT nErrcount;            // Count of returned errors on stack
AT_MODE valueType;
DWORD valueSize;
DWORD bufferSize;
// Get a type and a size of the control parameter
nErrcount = IG_fltr_ctrl_get(IG_FORMAT_TIF, "BUFFER_SIZE", FALSE, &valueType, &valueSize, NULL, 0);
if(nErrcount == 0)
{
    // Get the control parameter
    if(valueType == AM_TID_DWORD && valueSize == sizeof(DWORD))
    {
        nErrcount = IG_fltr_ctrl_get(IG_FORMAT_TIF, "BUFFER_SIZE", FALSE, NULL, NULL, &bufferSize, sizeof(bufferSize));
        
        // ...
    }
}

Remarks:

The application is responsible for allocating memory for lpBuffer and freeing it when it is no longer in use.

Use function IG_fltr_ctrl_set to change the value of a control parameter .

See also the section Loading and Saving.