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;


Demos

  Demos\Multi\...
  Demos\Actions\Actions_MView\MViewActions.dpr


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


Example

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
  Proc (Image editing and analysis methods)
  MIO (Loading, saving, acquisition and printing)

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

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

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

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

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

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

Thumbnail Spacing
  BottomGap
  HorizBorder
  LeftGap
  RightGap
  UpperGap
  VertBorder

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

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

Checkboxes
  Checkboxes
  Checked
  CheckedCount
  CheckboxPos
  SetCheckboxParams
  CheckAll
  UncheckAll

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

ScrollBars
  CurrentScrollBars
  HScrollBarParams
  ScrollBars
  ScrollBarsAlwaysVisible
  VScrollBarParams

Single Frame View
  DisplayMode
  Playing
  PlayLoop
  PlaySpeed
  TransitionDuration
  TransitionEffect
  TransitionRunning
  VisibleFrame

Other
  AddThumbButtons
  AssignLayers
  CalcGridHeight
  CalcGridWidth
  DesignTimeView
  DrawVersion
  IEBeginDrag
  IEEndDrag
  IEMBitmap
  ImageEnVersion
  SetExternalMBitmap
  StoreType
  Update


Events

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

Loading Events
  OnAllDisplayed
  OnGetLoadFilename
  OnImageIDRequestEx
  OnImageIDRequest
  OnImageLoaded
  OnIOProgress
  OnWrongImage

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

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