ImageEn, unit iemview

TImageEnMView


Declaration

TImageEnMView = class(TIECustomMView);


Description

The TImageEnMView component is similar to a TImageEnView, but is designed for multiple images:
- Multiple images can be displayed in a grid (similar to a thumbnail view in Windows Explorer)
- A single frame of a multiple-frame image (such as a GIF, AVI or TIFF) can be displayed. This can also be animated.




ImageEn supports loading and saving multiple frames from GIF, TIFF, AVI, DCX, DICOM and ICO formats. It can also load from CUR format, 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 when 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:
- TImageEnFolderMView: For displaying images in a folder
- TImageEnLayerMView: For displaying layers of an image

TImageEnMView supports VCL Theming:




Note: Do not attach a TImageEnIO component to TImageEnMView. Only the TImageEnMIO component can be attached to a TImageEnMView component, or you can use embedded MIO object.


Overview

        



Display Styles

There are four 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


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;


Keyboard Shortcuts

The following keyboard shortcuts are supported:

Shortcut Description Option to Enable
Cursor Keys Navigate mkiMoveSelected
Ctrl/Shift+Cursor Keys Select multiple files mkiMoveSelected
Numbers and letters Select next filename starting with a letter mkiLetterNavigation
Ctrl+A Select all files mkiMoveSelected


Demos

Demo Description Demo Project Folder Compiled Demo
ImageEnMView Actions Multiple Image and thumbnail application built using only ImageEnMView actions \Demos\Actions\Actions_MView\MViewActions.dpr   
Contact Sheets Output thumbnail pages to file, bitmap or printer \Demos\Multi\ContactSheets\ContactSheets.dpr   
Create Transition Frames Inserting transition frames into a TImageEnMView or saving them to file \Demos\Multi\CreateTransitionFrames\CreateTransitionFrames.dpr   
Custom Draw on Thumbnail Custom drawing of checkboxes onto thumbnails \Demos\Multi\CustomThumbs2\CustomThumbs2.dpr   
Custom Draw Thumb Background Show thumbnails for images in a folder with custom drawn background \Demos\Multi\CustomThumbs\Thumbs.dpr   
Dragging between TImageEnMViews Dragging of images between multiple TImageEnMView \Demos\Multi\DragDrop_MultiView\TImageEnMView_DD.dpr   
Dragging from TImageEnMView Extracting images from multiple-image files (such as TIFF, GIF, etc.) using drag and drop \Demos\Multi\DragDrop_FileList_2\TImageEnMView_FileList.dpr   
Dragging to TImageEnMView Adding images to a TImageEnMView using drag and drop \Demos\Multi\DragDrop_FileList_1\FileList_TImageEnMView.dpr   
Dragging within TImageEnMView Dragging of images within a TImageEnMView \Demos\Multi\DragDrop_MultiView2\Multiview2.dpr   
ImageEnMView Filtering Hiding thumbnails from display based on filename and other properties \Demos\Multi\Filtering\Filtering.dpr   
ImageEnMView Styles Changing styles and display modes of a TImageEnMView \Demos\Multi\MViewStyles\MViewStyles.dpr   
ImageEnMView Preview Using a TImageEnMView with a TImageEnView for previewing and navigation \Demos\Multi\MViewPreview\MViewPreview.dpr   
ImageEnMView with Viewer Attaching a TImageEnView to a TImageEnMView for previewing and navigation \Demos\Multi\MView_AttachedViewer\MViewPreview.dpr   
OnDemand Loading Load Windows stock icons as they are displayed in a TImageEnMView using OnImageIDRequestEx \Demos\Multi\Multi-OnDemand\MViewOnRequest.dpr   
Performance Features Overview of TImageEnMView options that improve performance \Demos\Multi\MViewPerformance\Performance.dpr   
Print Multiview Frame Print the selected frame of a multiple-image file such as AVI, TIFF and GIF \Demos\Multi\Multiview_PrintFrame\Multiview.dpr   
Thumbnail Buttons Adding buttons to each of your thumbnails \Demos\Multi\ThumbButtons\ThumbButtons.dpr   
Thumbnail Viewer Using TImageEnMView to show thumbnails for images in a folder \Demos\Multi\Thumbnails\Thumbs.dpr   
Thumbnails with Checkboxes Using Checkboxes to select thumbnails \Demos\Multi\Checkboxes\Checkboxes.dpr   
Styled Thumbnails Show thumbnails with preset styles \Demos\Multi\Thumbnails2\Thumbs.dpr   
View All Frames Use TImageEnMView to view frames and animate multiple-image files such as AVI, TIFF and GIF \Demos\Multi\Multiview\Multi.dpr   
View Meta-data Annotations Display Wang annotations and ImageEn layers from the meta-data of images in TImageEnMView and TImageEnView \Demos\Multi\Multiview2\Multiview2.dpr   
Large TIFF Viewer and Editor Edit and view pages of very large TIFF files using TIETIFFHandler and TImageEnMView \Demos\InputOutput\TiffHandler2\TiffHandler2.dpr   
"Coverflow" Effect Demo of "Coverflow" style effect using a TImageEnMView \Demos\Display\MViewFlow\MViewFlow.dpr   
Morphing Morphing of two images \Demos\ImageEditing\Morphing\Morphing.dpr   
Mouse Wheel Params The effect of the TImageEnView and TImageEnMView MouseWheelParams properties \Demos\Other\MouseWheel\MouseWheelParams.dpr   


Examples

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);


Methods and Properties

Embedded Components
Public Property  Proc (Image editing and analysis methods)
Public Property  MIO (Loading, saving, acquisition and printing)

Display
Public Property  Animation
Public Property  AnnotationsVisible
Published Property  AttachedImageEnView
Published Property  AutoAdjustStyle
Published Property  Background
Published Property  BackgroundColor2
Published Property  BackgroundStyle
Published Property  BiDiMode
Public Method  CenterFrame
Public Property  DefaultFileIcon
Public Method  DisplayImageAt
Published Property  FilenameFilter
Published Property  GradientEndColor
Published Property  GridWidth (Column count)
Public Method  LockPaint
Public Property  LockPaintCount
Public Method  LockUpdate
Public Property  LockUpdateCount
Public Property  MaximumViewX
Public Property  MaximumViewY
Public Property  MissingFileIcon
Public Method  SetChessboardStyle
Public Method  SetModernStyling
Public Method  SetStyleEx
Public Method  SetViewXY
Published Property  Style
Public Method  UnfilteredCount
Public Method  UnlockPaint
Public Method  UnlockUpdate
Public Property  ViewX
Public Property  ViewY
Published Property  Wallpaper
Published Property  WallpaperStyle

Editing
Public Method  Assign
Public Method  AssignEx
Public Method  AppendImage
Public Method  AppendSplit
Public Method  Clear
Public Method  CreateMorphingSequence
Public Method  DeleteImage
Public Property  ImageCount
Public Method  InsertImageEx
Public Method  InsertImage
Public Method  InsertTransitionFrames
Public Method  MoveImage
Public Method  RemoveBlankPages
Public Method  RemoveDuplicates
Public Method  Sort

Image Access
Public Property  Bitmap
Public Method  CopyToIEBitmap
Public Method  GetBitmap
Public Method  GetTIEBitmap
Public Property  IEBitmap
Public Method  PrepareSpaceFor
Public Method  ReleaseBitmap
Public Method  SetImage
Public Method  SetImageEx
Public Method  SetImageRect
Public Method  UpdateImage

Image Information
Public Method  FilenameToIndex
Public Property  ImageBackground
Public Property  ImageBitCount
Public Property  ImageCol
Public Property  ImageCreateDate
Public Property  ImageDelayTime
Public Property  ImageEditDate
Public Property  ImageFileName
Public Property  ImageFileSize
Public Property  ImageFileType
Public Property  ImageFiltered
Public Property  ImageHeight
Public Property  ImageID
Public Property  ImageOriginalHeight
Public Property  ImageOriginalWidth
Public Property  ImageRow
Public Property  ImageTag
Public Property  ImageUserPointer
Public Property  ImageWidth
Public Property  ImageX
Public Property  ImageY

Image Text
Published Property  BottomTextFont
Published Property  DefaultBottomText
Published Property  DefaultInfoText
Published Property  DefaultTopText
Public Property  ImageBottomText
Public Property  ImageInfoText
Public Property  ImageTopText
Published Property  InfoTextFont
Published Property  ParentFont
Published Property  ReadOnly
Published Property  SelectedFontColor
Public Method  SetAllText
Public Property  ShowText
Public Property  TextColumnWidths
Public Property  TextBackgroundColor
Public Property  TextBackgroundStyle
Public Property  TextBlockWidth
Published Property  TextMargin
Published Property  TextTruncSide
Published Property  TopTextFont

Thumbnail Appearance
Published Property  EnableAlphaChannel
Public Property  FillThumbnail (Highlight Selection)
Public Property  IconSize
Public Method  SetThumbnailSize
Published Property  ShowThumbnailHint
Public Property  SoftShadow
Published Property  ThumbnailClipping
Published Property  ThumbnailDisplayFilter
Public Property  ThumbnailFrameRect
Public Property  ThumbnailFrameSelected
Public Property  ThumbnailFrame
Published Property  ThumbHeight
Published Property  ThumbnailResampleFilter
Published Property  ThumbnailsBackground
Published Property  ThumbnailsBackgroundHover
Published Property  ThumbnailsBackgroundSelected
Published Property  ThumbnailsBackgroundStyle
Published Property  ThumbnailsBorderColor
Published Property  ThumbnailsBorderCurved
Published Property  ThumbnailsBorderWidth
Published Property  ThumbnailsInternalBorderColor
Published Property  ThumbnailsInternalBorder
Published Property  ThumbnailOptionsEx
Public Property  ThumbsRounded
Public Method  ThumbSizeInfo
Published Property  ThumbWidth
Published Property  Zoom

Thumbnail Spacing
Published Property  BottomGap
Published Property  HorizBorder
Published Property  LeftGap
Published Property  RightGap
Published Property  UpperGap
Published Property  VertBorder

Input/Output
Public Method  ClearImageCache
Published Property  DiskCache
Public Property  EnableAdjustOrientation (Auto-Rotate)
Public Property  EnableImageCaching
Public Property  EnableLoadEXIFThumbnails
Public Property  EnableLoadExplorerThumbnails
Public Method  EnsureImageLoaded
Public Property  WicFastLoading
Public Method  FillFromDirectory
Public Method  FillFromList
Public Method  GetImageToFile
Public Method  GetImageToStream
Published Property  ImageCacheSize
Public Property  ImageCacheUseDisk
Published Property  IOOptionsEx
Public Property  JobsRunning
Public Property  JobsWaiting
Public Method  LoadFromFileOnDemand
Public Method  LoadSnapshot
Public Property  LookAhead
Public Property  MaintainInvisibleImages
Public Method  ReloadImage
Public Method  SaveSnapshot
Public Method  Seek
Public Method  SetImageFromFile
Public Method  SetImageFromStream
Published Property  ThreadPoolSize

Selections
Public Method  BeginSelectImages
Public Method  CenterSelected
Public Property  CheckThumbBoundsOnSelect
Public Method  DeleteSelectedImages
Public Method  Deselect
Published Property  EnableMultiSelect
Public Method  EndSelectImages
Public Method  IsSelected
Public Method  MoveSelectedImagesTo
Public Property  MultiSelectedImages
Public Property  MultiSelectedImagesCount
Public Property  MultiSelectedImagesList
Public Property  MultiSelecting
Published Property  MultiSelectionOptions
Public Method  SelectAll
Public Property  SelectedFilename
Public Method  SelectedFilenames
Public Property  SelectedImage
Public Property  SelectedImageAlwaysVisible
Published Property  SelectionColor
Published Property  SelectionWidth
Public Property  SelectionWidthNoFocus
Public Method  SelectSeek
Public Method  UnselectImage
Published Property  VisibleSelection

Checkboxes
Published Property  Checkboxes
Public Property  Checked
Public Method  CheckedCount
Public Property  CheckboxPos
Public Method  SetCheckboxParams
Public Method  CheckAll
Public Method  UncheckAll

User Interaction
Public Property  Gestures
Public Method  GetImageVisibility
Public Method  ImageAtGridPos
Public Method  ImageAtPos
Public Method  InsertingPoint
Public Method  IsVisible
Published Property  KeyInteract
Published Property  MouseInteract
Published Property  MouseWheelParams (Default)
Published Property  MouseWheelParamsAlt (Ctrl Key)
Published Property  PopupMenus

ScrollBars
Public Property  CurrentScrollBars
Public Property  HScrollBarParams
Published Property  ScrollBars
Public Property  ScrollBarsAlwaysVisible
Public Property  VScrollBarParams

Single Frame View
Published Property  DisplayMode
Public Property  Playing
Public Property  PlayLoop
Public Property  PlaySpeed
Published Property  TransitionDuration
Published Property  TransitionEffect
Public Property  TransitionRunning
Public Property  VisibleFrame

Other
Public Method  AddThumbButtons
Public Method  AssignLayers
Public Method  CalcGridHeight
Public Method  CalcGridWidth
Published Property  DesignTimeView
Published Property  DrawVersion
Public Method  IEBeginDrag
Public Method  IEEndDrag
Public Property  IEMBitmap
Published Property  ImageEnVersion
Public Method  LoadProperties
Public Method  SaveProperties
Public Method  SetExternalMBitmap
Published Property  StoreType
Public Method  Update


Events

User Interaction Events
Event  OnActionExecute
Event  OnCheckboxClick
Event  OnEditText
Event  OnImageDeselect
Event  OnImageSelect
Event  OnImageEnGesture
Event  OnMouseEnter
Event  OnMouseLeave
Event  OnSelectionChanging
Event  OnZoomIn
Event  OnZoomOut

Loading Events
Event  OnAllDisplayed
Event  OnGetLoadFilename
Event  OnImageIDRequestEx
Event  OnImageIDRequest
Event  OnImageLoaded
Event  OnIOProgress
Event  OnWrongImage

Paint Events
Event  OnAnimationText
Event  OnBeforeImageDrawEx
Event  OnBeforeImageDraw
Event  OnDrawProgress
Event  OnGetColors
Event  OnGetText
Event  OnGetTextEx
Event  OnImageDraw
Event  OnImageDraw2
Event  OnImageOut

Other Events
Event  OnAcquireBitmap
Event  OnAfterEvent
Event  OnChanged
Event  OnCreateImage
Event  OnCreateParams
Event  OnDestroyImage
Event  OnFilter
Event  OnFinishWork
Event  OnGetHint
Event  OnImageAdd
Event  OnImageAdded
Event  OnImageAtPos
Event  OnPlayFrame
Event  OnPrintPage
Event  OnProgress
Event  OnShowDialog
Event  OnUndoRedo
Event  OnViewChange