ImageEn, unit iemview

TImageEnMView.AttachedImageEnView

TImageEnMView.AttachedImageEnView


Declaration

property AttachedImageEnView: TImageEnView;


Description

Use this property to attach a TImageEnView to this TImageEnMView.

It operates in two modes:

Preview of Selected TImageEnMView thumbnail

If you add into the TImageEnMView (e.g. using ImageEnMView.MIO.LoadFromFile) a full size preview of the selected image will be shown in the attached TImageEnView.
You can also navigate the TImageEnMView using the TImageEnView Buttons or mouse wheel if the MouseWheelParams.Action = iemwNavigate.
Ensure you set StoreType. If set to ietNormal, images will be assigned to the TImageEnView for display. If possible, you are better to set it to ietFastThumb, which will improve memory handling. When StoreType is set to ietThumb or ietFastThumb, the TImageEnView will attempt to load the original file when previewing.

Note:
To prevent the loading from locking the UI, set AsyncLoading to false
AttachedImageEnView will have no effect if you have assigned an external bitmap to the TImageEnView
You can use UpdateAttachedImageEnView to force loading of the image into the attached TImageEnView
Before loading a new image, the OnBeforeLoadImage event will fire in the TImageEnView. After loading, OnImageLoaded will fire


Pages of the loaded PDF

If you have loaded a PDF file into the PDF Viewer of the AttachedImageEnView (e.g. using ImageEnView1.IO.LoadFromFile), the TImageEnMView will show all the PDF pages and allow document navigation.
In this case, your setting of StoreType is important. It should be one of:
ietFastThumb: PDF pages are loaded as they are displayed in the TImageEnMView
ietThumb: All PDF pages are loaded at the outset into the TImageEnMView


Demos

Demo  Demos\Multi\Multiview\Multi.dpr
Demo  Demos\Multi\MView_AttachedViewer\MViewPreview.dpr
Demo  Demos\Actions\Actions_PdfViewer\PdfViewerActions.dpr


Preview Examples

// Attach a TImageEnView to a TImageEnMView and show the pages of a TIFF
ImageEnMView1.AttachedImageEnView := ImageEnView1;
ImageEnMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.MouseWheelParams.Action  := iemwNavigate;
ImageEnView1.ShowButtons := [ iebtPrevious, iebtNext ];     // Allow navigation by buttons on the TImageEnView
ImageEnMView1.MIO.LoadFromFile( 'C:\My Image.tiff' );

// Attach a TImageEnView to a TImageEnFolderMView and show images in a folder
IEFolderMView1.AttachedImageEnView := ImageEnView1;
IEFolderMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.MouseWheelParams.Action  := iemwNavigate;
ImageEnView1.ShowButtons := [ iebtPrevious, iebtNext ];      // Allow navigation by buttons on the TImageEnView
IEFolderMView1.Folder := 'C:\Pictures\';


PDF Examples

// Show thumbnail preview of all pages of a PDF document (loading pages as they are displayed)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnMView1.StoreType := ietFastThumb;
ImageEnMView1.AttachedImageEnView := ImageEnView1;
ImageEnMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Show thumbnail preview of all pages of a PDF document (loading all pages immediately)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnMView1.StoreType := ietThumb;
ImageEnMView1.AttachedImageEnView := ImageEnView1;
ImageEnMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );