ImageEn, unit imageenview |
|
TImageEnView.OnImageLoaded
Declaration
property OnImageLoaded: TNotifyEvent;
Description
Occurs whenever an image has been loaded. This event will fire after:
◼Loading an image using
TImageEnView.IO.LoadFromFile
◼Navigating to a new image using
buttons or the
mouse wheel
◼Selecting a new image in a
TImageEnMView when
attached to this control
OnImageLoaded is useful to update your UI when you are
loading asynchronously.
Also see:
OnBeforeLoadImage
Note:
◼When loading completes OnImageLoaded and
OnFinishWork will both fire
◼To get the filename of the loaded image, use
Filename
◼This event is the same as ieftAfterLoad in
OnIONotify
// Load images in background thread
procedure TMainForm.btnLoadClick(Sender: TObject);
begin
ImageEnView1.AsyncLoading := True;
ImageEnView1.IO.LoadFromFile( IEFolderMView.SelectedFilename );
end;
// Update the UI
procedure TMainForm.ImageEnView1ImageLoaded(Sender: TObject);
begin
lblFN.Caption := Format( 'Filename: %s', [ ExtractFilename( ImageEnView1.IO.Params.FileName )]);
lblIdx.Caption := Format( 'Image Number: %d', [ ImageEnView1.IO.Params.ImageIndex + 1 ]);
lblDim.Caption := Format( 'Size: %d x %d px', [ ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height ]);
end;