ThumbnailXpress 6 for .NET - User Guide > How To > Load and Display Thumbnails > Generate Thumbnails from File |
ThumbnailXpress™ provides the user with the ability to generate thumbnails from one or more pages of a local or remote file.
PDF support is deprecated in ImagXpress; instead, please use PDF Xpress for PDF support via the UsePdfXpressForPDFsOnly property. |
Call ThumbnailItemCollection AddItemsFromFile to load and generate thumbnails from one or more pages of a file. When the ExpandMultiPage parameter is set to true, a thumbnail will be generated for each page in a multi-page file. When the ExpandMultiPage parameter is set to false, only the first page is generated, and the thumbnail icon will show a "+" to indicate that the thumbnail is the first page of a multi-page file.
Alternatively, a thumbnail can be added or inserted into the collection by defining a ThumbnailItem, then calling a ThumbnailItemCollection Insert or Add method. If the Verify parameter is included and set to true, ThumbnailXpress will check to make sure that the local file specified in the supplied ThumbnailItem has a valid file name (e.g. it exists and can be understood by the control).
If the file name indicates a remote path, the Verify parameter is ignored. |
When defining a ThumbnailItem, the application can specify the Filename, Page, and if CAD, the CadLayoutNumber to access. The application provides the Descriptor to be displayed with the thumbnail, and a UserTag to record application-specific information about the thumbnail.
C# |
Copy Code
|
---|---|
// Generate a thumbnail from file. ThumbnailXpress1.Items.AddItemsFromFile("c:\\bird.jpg", 0, true); // Create and add a thumbnail item for page 3 of multi.tif. ThumbnailItem item = ThumbnailXpress1.CreateThumbnailItem("c:\\multi.tif", 2, ThumbnailType.Image); // Optionally set a custom descriptor. By default the filename will be used for the descriptor. ThumbnailXpress1.DescriptorDisplayMethod = DescriptorDisplayMethods.Custom; item.Descriptor = "my descriptor"; item.UserTag = "my tag"; // Optionally set a user tag. ThumbnailXpress1.Items.Add(item); // Create a thumbnail item for bird.jpg and insert it into the first position. ThumbnailItem item2 = ThumbnailXpress1.CreateThumbnailItem("c:\\bird.jpg", 0, ThumbnailType.Image); ThumbnailXpress1.Items.Insert(0, item2); |