L_LTFIL_API L_INT L_SetFilterInfo(pFilterInfo, uFilterCount, uFlags)
Changes all of the filter information obtained in the array ppFilterList parameter by calling the L_GetFilterListInfo function; or changes the information foe a specific filter obtained in
pFilterInfo parameter by calling the L_GetFilterInfo function.
Pointer to FILTERINFO structure containing filter information. This parameter cannot be NULL. This pointer points to either an array of information for all filters (obtained by the L_GetFilterListInfo function); or to information for a specific filter 9obtained by the L_GetFilterInfo function).
Value that represents the number of elements in the pFilterInfo parameter. Possible values are:
|1||Change only the memory stored inside the
|> 1||Change the memory allocated in the array of information for all filters obtained in the ppFilterList parameter by calling L_GetFilterListInfo function.|
Reserved for future use. Pass 0.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
The filters are identified by the value of pFilterInfo.szName.
There are currently three types of information that can be changed for a filter:
The extension list associated with a specific filter.
LEADTOOLS will use the extension list specified by the value of pFilterInfo.pszExtensionList member to quickly test the file format. Whenever L_FileInfo function is called for a certain file, the file extension is matched against all the extension lists associated with the file filters. For example, the CMP filter is used to check for files with extensions cmp, jpg, jpeg or tif. If you want to check files with a specextension intended to check, add them to the usual extension list and call L_SetFilterInfo function.
Extended filter checking for a file. Extended filter checking is specified by the value of pFilterInfo.uFlags member:
Set the pFilterInfo.uFlags member to the FILTERINFO_CHECKEDBYFILEINFO flag to specify that extended filter checking is to be used. The L_FileInfo function will check a certain filter even if its extension does not match any in the extension list.
Do not set the pFilterInfo.uFlags member to FILTERINFO_CHECKEDBYFILEINFO flag if extended filter checking should not be used. The L_FileInfo function will check a certain filter ONLY if its extension is in the extension list.
Some vector filters have a slow check to detect whether a file is of a certain format. In certain cases, the whole file needs to be parsed. If the L_FileInfo function is taking too long, do not set the pFilterInfo.uFlags member to FILTERINFO_CHECKEDBYFILEINFO flag. The L_FileInfo function will check a certain filter ONLY if its extension on of the usual extensions associated with that filter.
Set the pFilterInfo.uFlags member to the FILTERINFO_SLOWFILEINFO flag to specify that the process of obtaining the file information for a filter will be slow.
How the filter will be handled. The method of handling the filter is specified by the value of the pFilterInfo.uFlags member. If it is set to:
|FILTERINFO_IGNORED||Ignore the filter. In this case, the user cannot load, save or get information for files handled by this filter. This flag overrides the other flags. For more information, refer to the L_IgnoreFilters function.|
|FILTERINFO_FIXED||Fix the filter in memory. Fixed filters will not be unloaded even when the maximum number of filters that can be loaded in memory is reached.|
|To set the maximum number of filters that will be loaded at a certain time, specify the value of the nFixedFilters parameter of the L_PreLoadFilters function.|
|FILTERINFO_DYNAMIC||Load and unload the filter dynamically as required. LEADTOOLS will load filters when the user loads, saves or checks files of the corresponding format. When the maximum number of filters has been loaded, the least recently used filter will be unloaded.|
|To set the number of filters that can be loaded and unloaded dynamically, specify the value of nCachedFilters parameter of L_PreLoadFilters function.|
|If neither FILTERINFO_IGNORED nor FILTERINFO_FIXED is set in the pFilterInfo.uFlags member, FILTERINFO_DYNAMIC will be used automatically.|
|You can check whether the filter is dynamic with the following statement:|
|(uFlags & FILTERINFO_LOADMASK) == FILTERINFO_DYNAMIC|
If the filter name (
pFilterInfo.szName member) is invalid, the function will return ERROR_INV_FILTERNAME error code.
Required DLLs and Libraries
For an example, refer to L_GetFilterInfo.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries