ThumbnailXpress™ v4 enables loading of images from a directory, based on specified filter criteria. One or more filters can be defined, enabling customized search and display of thumbnail images. ThumbnailXpress keeps a list of filters that have been defined, and applies all enabled filters when loading images from a directory.
Add or Delete a Filter
To add a filter, call AddFilterItem, specifying a name for the filter. An index is returned, uniquely identifying the filter in the list. The filter's name can be modified at any time by calling SetFilterName. The filter's index can be found at any time by calling FindFilterItemIndex and specifying the filter name. To delete all filters from the ThumbnailXpress control, call ClearFilters.
Assign Filter Criteria
To assign search criteria to a filter, first call SetFilterType to specify the type of filter being defined. Filter types include:
- Filtering based on file name
- Filtering based on file attributes (e.g. include hidden files, include parent directory, include subdirectories)
- Filtering based on File creation date
- Filtering based on File modification date
- Filtering based on File size
- Filtering to include only files that are supported by ThumbnailXpress
Based on the filter type, additional filter criteria will be applied.
If filtering based on file name or directory name:
- Call SetFilterCaseSensitive to indicate whether the search should consider the font case.
- Call SetFilterFilenamePattern to specify the name or wildcard expressions to search for. This includes specifying filename extensions, such as .jpg or .tiff.
- Call SetFilterMatchAppliesToDirectory to specify whether the FilterFilenamePattern should apply to directory names as well.
If filtering based on file attributes:
- Call SetFilterIncludeHidden to specify whether hidden files should be included in the search.
- Call SetFilterIncludeParentDirectory to specify whether a file's parent directory should be included in the search.
- Call SetFilterIncludeSubDirectory to specify whether sub-directories should be included in the search.
If filtering based on creation or modification date:
- Call SetFilterComparison, to specify the comparison criteria for the filter (e.g. less than, greater than, equal).
- Call SetFilterDate to specify the date to compare against.
If filtering based on file size:
- Call SetFilterComparison, to specify the comparison criteria for the filter (e.g. less than, greater than, equal).
- Call SetFilterSize to indicate the maximum size files to include.
Generate Thumbnails from Files Within a Directory
Filters are applied when loading images from a directory into the ThumbnailXpress control. All enabled filters will be applied to determine which images to load. Call SetFilterEnabled to indicate the filters to use. If no filters are enabled, then all folders and files will be loaded.
Call AddDirectoryItems to load images and generate thumbnails from all files in the specified directory. All enabled filters are applied, and only items that meet all filter criteria are loaded. A thumbnail image is then generated for each loaded image, and cached. When the control paints, the thumbnail images are displayed.
![]() |
If the directory contains multi-page files, only the first page of the file is loaded. The thumbnail icon will show a "+" to indicate that the thumbnail is the first page in a multi-page file. Thumbnails of additional pages within the file can be added by calling AddFileItems. |
