L_GetIgnoreFilters - Raster Imaging C API Help

L_GetIgnoreFilters

#include "l_bitmap.h"

L_LTFIL_API L_SSIZE_T L_GetIgnoreFilters(pszFilters, uSize);

L_TCHAR * pszFilters;

character string to be updated with filters

L_SIZE_T uSize;

size in bytes of pszFilters

Retrieves the current ignored filters list that LEADTOOLS should never load, even if present.

Parameter

Description

pszFilters

Pointer to a character string to be updated with the current ignored filters list.

uSize

The size in bytes of the buffer pointed to by pszFilters.

Returns

>=0

The size in bytes of the ignored filters list.

Comments

In case the current ignored filters list should be changed, call this function before calling the L_IgnoreFilters function.

To retrieve the ignored filters list, the user should do the following:

1.

Call the function passing pszFilters as NULL and uSize as 0 to retrieve the size required for the filters list as returned value.

2.

Allocate a buffer of size (Returned Value * sizeof(L_TCHAR)).

3.

Call the function passing the allocated buffer to the pszFilters and the returned value to uSize to retrieve the filters list.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64, Linux.

See Also

Functions:

L_IgnoreFilters, L_PreLoadFilters, L_GetPreLoadFilters

Topics:

Raster Image Functions: Input/Output File Filters

 

Loading File Filters

Example

L_INT GetIgnoreFiltersExample(L_VOID) 
{ 
   L_TCHAR * pszList = NULL;  
   L_SIZE_T nRet;  
   BITMAPHANDLE Bitmap;  
 
   /* get the original filters list */ 
   nRet =L_GetIgnoreFilters(NULL, 0);  
   pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));  
   nRet =L_GetIgnoreFilters(pszList, nRet);  
   MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);  
   free(pszList);  
 
   /* ignore TGA filter */ 
   nRet =L_IgnoreFilters(TEXT("TGA")); 
   if(nRet !=SUCCESS) 
      return (L_INT)nRet; 
 
   /* get the new filters list */ 
   nRet =L_GetIgnoreFilters(NULL, 0); 
   if(nRet < 0) 
      return (L_INT)nRet; 
   pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));  
   nRet =L_GetIgnoreFilters(pszList, nRet); 
   if(nRet < 0) 
      return (L_INT)nRet; 
   MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);  
   free(pszList);  
 
   /* try to load TGA, should fail: ERROR_FILE_FORMAT */ 
   nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("test.tga")), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);  
   if(nRet != SUCCESS) 
   { 
      if(nRet == ERROR_FILE_FORMAT)  
         MessageBox(NULL, TEXT("TGA ignored"), TEXT("TEST"), MB_OK);  
      return (L_INT)nRet; 
   } 
 
   if(Bitmap.Flags.Allocated)  
      L_FreeBitmap(&Bitmap); 
 
   return SUCCESS; 
   } 
Help Version 20.0.2018.7.30
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help