L_PreLoadFilters

#include "l_bitmap.h"

L_LTFIL_API L_INT L_PreLoadFilters(nFixedFilters, nCachedFilters, pszFilters)

L_INT nFixedFilters;

number of filters that stay loaded

L_INT nCachedFilters;

number of filters that are loaded, but may be unloaded later

L_TCHAR* pszFilters;

character string containing filters

Specifies the file format filters to be loaded.

Parameter

Description

nFixedFilters

Number of filters that should stay loaded in memory at all times.

nCachedFilters

Number of filters that should be loaded, but can be unloaded later to make room for other filters.

pszFilters

Character string containing the filters which should be loaded. If pszFilters is NULL, all file filters LEADTOOLS can find will be loaded and LEADTOOLS will determine the order in which the files will be used. pszFilters is in the form xyz, yuv... where XYZ are the 3 letters describing the file filter as in LFxyzW.DLL or LFxyzu.dll. For instance, if pszFilter is PCX,TIF,CMP then LFPCXu.dll will be loaded then LFTIFu.dll and then LFCMPu.dll will be loaded. The first nFixedFilters will stay in memory at all times, then the next nCachedFilters will be loaded. However, if other filters will be needed, the cached filters might be unloaded to make room for the new DLLs. It is recommended that the most commonly used DLLs be loaded as fixed to minimize the time required to load/unload file filters. Also, some DLLs may require additional DLLs (like the LFFPXu.dll) so the exact number of DLLs loaded is not necessarily nFixedFilters + nCachedFilters. For more information on available DLLs, refer to Files To Be Included With Your Application.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Some operating systems (like Windows 95) have a limit for the number of DLLs that can be loaded at a time and that limit can be quickly reached, especially if there are several other third party libraries loading DLLs, or if the programming environments themselves load many DLLs. You can use this function to restrict the number of file import/export DLLs that LEADTOOLS will load. Note that the fewer DLLs loaded, the slower the loading/saving of files will be, since there will be more loading/unloading of DLLs.

Please note that L_PreLoadFilters has effect only if called before the first time you try to load, save or get information about a file. If you try to load, save or get information about a file without calling L_PreLoadFilters first, LEAD loads default filters. For more information, refer to Loading File Filters.

If the previously loaded DLLs should be changed, call the L_GetPreLoadFilters function before calling this function.

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_GetPreLoadFilters, L_GetIgnoreFilters, L_SetFilterInfo

Topics

Raster Image Functions: Input/Output File Filters,

Example

This example preloads the BMP, PCX, and TIFF filters, and allows 1 filter to be cached, while always keeping 2 loaded.

L_INT PreLoadFiltersExample(L_VOID) 
{ 
   L_INT nRet; 
   nRet = L_PreLoadFilters( 2, 1, TEXT("BMP,PCX,TIF")); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help