ImageEn, unit imageenview |
|
TImageEnView.OnImageLoaded
Declaration
property OnImageLoaded: TNotifyEvent;
Description
Occurs whenever an image has been loaded (e.g. using
TImageEnView.IO.LoadFromFile.
OnImageLoaded is useful to update your UI when you are
loading asynchronously.
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;