Properties · Methods · Events · Demos · Examples
Declaration
TImageEnMView = class(TIECustomMView);
Description
The TImageEnMView is a display component for multiple images (frames of a video or multiple image format, like GIF, or thumbnails of images, e.g. images in a folder).
It embeds a multiple image container,
TIEMultiBitmap (
IEMBitmap property), and can display images in two ways:
◼As a grid of thumbnails (similar to a thumbnail view in Windows Explorer)
◼As a single frame of a multiple-frame image (such as a GIF, AVI or TIFF). This can also be animated.
TImageEnMView encapsulates a
TImageEnMIO (
MIO property) for loading, saving, acquisition and printing, and a
TImageEnProc (
Proc property) for editing of the selected image.
Frames can be loaded and saved from multiple image formats like GIF, TIFF, AVI, DCX, DICOM and ICO. It can also load from CUR and ZIP formats, and save to PDF and PS format (loading of PDF is supported if a
relevant plug-in is installed).
The images can be
stored as full images, as thumbnails (a sub-resampled image of the original), loaded only as they are displayed (you need only specify the file name), or upon request (an event is generated whenever an image needs to be shown).
Thumbnails for video formats are retrieved from Windows Explorer. This can be disabled or expanded by setting
MViewExplorerThumbnailExts.
For rapid UI development a full set of
actions is also available.
There are two descendent components of TImageEnMView:
TImageEnMView supports VCL Theming:
Overview
Display Styles
TImageEnMView offers five standard
styles. Ensure you set
AutoAdjustStyle := True; so that setting the style automatically updates all relevant properties.
iemsFlat | iemsFlatAndWide |
| |
iemsFilenames | iemsColumns |
| |
Thumbnail Performance
Because a TImageEnMView may potentially load and store thousands of files, you should optimize your settings to ensure the best performance. Take note of the following:
- Most importantly, decide whether to load and store full size images, or just preview thumbnails. If you are loading the content of a multi-page file, such as TIFF, for editing and display, then generally you will want StoreType=ietNormal. However, if you are displaying thousands of photos from a folder, for example, then you are better to use load only thumbnails (StoreType is ietThumb or ietFastThumb)
- Load images only on demand (i.e. as they are displayed or needed). To do this, ensure the LoadOnDemand parameter is set for AppendImage, InsertImage, FillFromDirectory or FillFromList. Or if you are just loading a single file with many pages, use LoadFromFileOnDemand
- Lock updating while performing batch operations (LockUpdate/UnlockUpdate)
- Consider options to load EXIF thumbnails or Windows Explorer thumbnails
- Choose a good balance between quality and speed when setting the ThumbnailResampleFilter
- Increasing the size of the image cache can help with general performance, especially when StoreType=ietFastThumb
- Set DeprioritizeLargeImages to a size larger than most images to prevent very large images from slowing the display
Recommended Defaults
For compatibility, some of the default options of TImageEnMView are not the recommended ones. Here are some suggested changes:
- Enable AutoAdjustStyle so you that setting Style will automatically update relevant layout properties:
ImageEnMView1.AutoAdjustStyle := True; - Call SetModernStyling to update the styling:
ImageEnMView1.SetModernStyling(); - Increase the size of the thumbnails (ThumbWidth/ThumbHeight):
ImageEnMView1.ThumbWidth := 140;
ImageEnMView1.ThumbHeight := 120; - Enable selection of multiple thumbnails:
ImageEnMView1.EnableMultiSelect := True; - Use form fonts for thumbnail text:
ImageEnMView1.ParentFont := True;
Keyboard Shortcuts
The following keyboard shortcuts are supported:
Note: Configure or disable individual keyboard shortcuts using
KeyboardShortcutsDebugging Visualizer
You can
view the content of a TImageEnMView while debugging by hovering over the object and clicking the Inspect button:
Demo | Description | Demo Project Folder | Compiled Demo |
ImageEnMView Actions | Multiple Image and thumbnail application built using only ImageEnMView actions | Actions\Actions_MView\MViewActions.dpr | |
Contact Sheets | Output thumbnail pages to file, bitmap or printer | Multi\ContactSheets\ContactSheets.dpr | |
Create Transition Frames | Inserting transition frames into a TImageEnMView or saving them to file | Multi\CreateTransitionFrames\CreateTransitionFrames.dpr | |
Custom Draw on Thumbnail | Custom drawing of checkboxes onto thumbnails | Multi\CustomThumbs2\CustomThumbs2.dpr | |
Custom Draw Thumb Background | Show thumbnails for images in a folder with custom drawn background | Multi\CustomThumbs\Thumbs.dpr | |
Dragging between TImageEnMViews | Dragging of images between multiple TImageEnMView | Multi\DragDrop_MultiView\TImageEnMView_DD.dpr | |
Dragging from TImageEnMView | Extracting images from multiple-image files (such as TIFF, GIF, etc.) using drag and drop | Multi\DragDrop_FileList_2\TImageEnMView_FileList.dpr | |
Dragging to TImageEnMView | Adding images to a TImageEnMView using drag and drop | Multi\DragDrop_FileList_1\FileList_TImageEnMView.dpr | |
Dragging within TImageEnMView | Dragging of images within a TImageEnMView | Multi\DragDrop_MultiView2\Multiview2.dpr | |
ImageEnMView Filtering | Hiding thumbnails from display based on filename and other properties | Multi\Filtering\Filtering.dpr | |
ImageEnMView Styles | Changing styles and display modes of a TImageEnMView | Multi\MViewStyles\MViewStyles.dpr | |
ImageEnMView Preview | Using a TImageEnMView with a TImageEnView for previewing and navigation | Multi\MViewPreview\MViewPreview.dpr | |
ImageEnMView with Viewer | Attaching a TImageEnView to a TImageEnMView for previewing and navigation | Multi\MView_AttachedViewer\MViewPreview.dpr | |
OnDemand Loading | Load Windows stock icons as they are displayed in a TImageEnMView using OnImageIDRequestEx | Multi\Multi-OnDemand\MViewOnRequest.dpr | |
Performance Features | Overview of TImageEnMView options that improve performance | Multi\MViewPerformance\Performance.dpr | |
Print Multiview Frame | Print the selected frame of a multiple-image file such as AVI, TIFF and GIF | Multi\Multiview_PrintFrame\Multiview.dpr | |
Thumbnail Buttons | Adding buttons to each of your thumbnails | Multi\ThumbButtons\ThumbButtons.dpr | |
Thumbnail Viewer | Using TImageEnMView to show thumbnails for images in a folder | Multi\Thumbnails\Thumbs.dpr | |
Thumbnails with Checkboxes | Using Checkboxes to select thumbnails | Multi\Checkboxes\Checkboxes.dpr | |
Styled Thumbnails | Show thumbnails with preset styles | Multi\Thumbnails2\Thumbs.dpr | |
View All Frames | Use TImageEnMView to view frames and animate multiple-image files such as AVI, TIFF and GIF | Multi\Multiview\Multi.dpr | |
View Meta-data Annotations | Display Wang annotations and ImageEn layers from the meta-data of images in TImageEnMView and TImageEnView | Multi\Multiview2\Multiview2.dpr | |
Large TIFF Viewer and Editor | Edit and view pages of very large TIFF files using TIETIFFHandler and TImageEnMView | InputOutput\TiffHandler2\TiffHandler2.dpr | |
"Coverflow" Effect | Demo of "Coverflow" style effect using a TImageEnMView | Display\MViewFlow\MViewFlow.dpr | |
Morphing | Morphing of two images | ImageEditing\Morphing\Morphing.dpr | |
Mouse Wheel Params | The effect of the TImageEnView and TImageEnMView MouseWheelParams properties | Other\MouseWheel\MouseWheelParams.dpr | |
procedure TForm1.FormCreate(Sender: TObject);
begin
// Setup TImageEnMView
ImageEnMView1.SetModernStyling(False); // Update to the most modern styling
ImageEnMView1.AutoAdjustStyle := True; // Enable so that setting "Style" will automatically update all relevant properties
ImageEnMView1.GridWidth := -1; // Automatically adjust the column count to match the control width
ImageEnMView1.ThumbWidth := 150; // Increase size of thumbnails
ImageEnMView1.ThumbHeight := 130; // Increase size of thumbnails
ImageEnMView1.EnableMultiSelect := true; // Enable selection of multiple files
ImageEnMView1.StoreType := ietThumb; // Normally don't need to store whole image in memory, just a sub-sampled thumbnail
end;
// Now display the images of a folder in the grid
ImageEnMView1.FillFromDirectory('C:\MyImages\', -1, False, '', False, '', True);
// Create an animated GIF file from ten source images
ImageEnMView1.Clear;
for i := 0 to 9 do
begin
ImageEnMView1.AppendImage( format( 'D:\Source\Frame %d.bmp', [i] ));
ImageEnMView1.MIO.Params[i].GIF_DelayTime := 10; // Display each frame for 1/10th of a second
end;
ImageEnMView1.MIO.SaveToFileGIF( 'D:\Animated.gif' );
Embedded Components | IEMBitmap (Container for images) |
| Proc (Image editing and analysis methods) |
| MIO (Loading, saving, acquisition and printing) |
DisplayEditingImage AccessImage InformationImage TextThumbnail AppearanceThumbnail SpacingInput/OutputSelectionsCheckboxesUser InteractionScrollBarsSingle Frame ViewOtherUser Interaction EventsLoading EventsPaint EventsOther Events