L_GetFilterListInfo

Summary

Retrieves an array of information for all filters.

Syntax

#include "l_bitmap.h"

L_LTFIL_API L_INT L_GetFilterListInfo(ppFilterList, pFilterCount)

Parameters

pFILTERINFO* ppFilterList

Pointer to a pointer to a FILTERINFO structure that represents an array of information for all filters. The address of this structure will be stored into *ppFilterList. This parameter cannot be NULL.

L_UINT* pFilterCount

Pointer to a variable to be updated with the number of elements of ppFilterList array.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The function will allocate a FILTERINFO structure large enough to contain the information of all filters.

When the array ppFilterList is no longer needed, the user is responsible to free this structure by calling the L_FreeFilterInfo(*ppFilterList, *pFilterCount, FILTERINFO_FREEALL) function.

To obtain the information for a specific filter, call the L_GetFilterListInfo function.

To update the information of a specific filter, call L_SetFilterInfo function.

To update the filter extension list, be sure to save and restore the original filter list before calling L_FreeFilterInfo function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example changes the extension list for the second filter in the list.
LEADTOOLS uses this filter only if the file extension is in the extension list that associated with the filter.

L_INT GetFilterListInfoExample(L_VOID) 
{ 
   pFILTERINFO pFilterList; 
   L_UINT uFilterCount; 
   L_TCHAR* pszOrigExtensionList; 
   L_INT nRet; 
 
   nRet =L_GetFilterListInfo(&pFilterList, &uFilterCount); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   // Save the original extension list so you can free it later 
   pszOrigExtensionList = pFilterList[2].pszExtensionList; 
 
   //Designate files with extension abc or cba as type 2 
   pFilterList[2].pszExtensionList = L_TEXT("abc,cba"); 
    
   // Remove the FILTERINFO_CHECKEDBYFILEINFO flag. This will make the 
   // L_FileInfo function checks for this filter only if the extension is in the extension list that have been set above 
   pFilterList[2].uFlags = pFilterList[2].uFlags & ~FILTERINFO_CHECKEDBYFILEINFO; 
 
   // Update the filter information. Note: This will affect all threads! 
   nRet =L_SetFilterInfo(&pFilterList[2], 1, 0); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   // Restore the original extension list 
   pFilterList[2].pszExtensionList = pszOrigExtensionList; 
 
   // Free the pFilterList array that was allocated with L_GetFilterListInfo 
   nRet =L_FreeFilterInfo(pFilterList, uFilterCount, FILTERINFO_FREEALL); 
   if(nRet !=SUCCESS) 
      return nRet; 
    
   return SUCCESS; 
} 

Help Version 22.0.2023.7.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.