Accusoft.ThumbnailXpress6.Net
Generate Thumbnails from Directory

ThumbnailXpress™ enables loading of images from a local or remote 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.

PDF support is deprecated in ImagXpress; instead, please use PDF Xpress for PDF support via the UsePdfXpressForPDFsOnly property.

Add or Delete a Filter

To add a filter, first define a Filter object, specifying the filter criteria. For example, directory items can be filtered based on FileSize, Type, and FileDate. The filter can be modified at any time by accessing the properties within the Filter. Next, add the filter by calling FilterCollection Add. An index is returned, uniquely identifying the filter in the list.

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.  If no filters are enabled, then all folders and files will be loaded.

Call ThumbnailItemCollection AddItemsFromDirectory to load images and generate thumbnails from all files that meet filter criteria in the specified directory. 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 AddItemsFromFile.
C#
Copy Code
// Optionally add filters to load all files with filenames ending in .bmp
// that are smaller than 500000 bytes.
Filter filenameFilter = ThumbnailXpress1.CreateFilter("file name");
filenameFilter.Type = FilterType.Filename;
filenameFilter.FilenamePattern = "*.bmp";
ThumbnailXpress1.Filters.Add(filenameFilter);
Filter filesizeFilter = ThumbnailXpress1.CreateFilter("file size");
filesizeFilter.Type = FilterType.FileSize;
filesizeFilter.Comparison = FilterComparison.LessThan;
filesizeFilter.FileSize = 500000;
ThumbnailXpress1.Filters.Add(filesizeFilter);

// Generate thumbnails from files within the C:\\ directory.
ThumbnailXpress1.Items.AddItemsFromDirectory("C:\\", 0);
See Also

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback