ImageEn, unit ieopensavedlg

TOpenImageEnDialog.OnPreviewFile

TOpenImageEnDialog.OnPreviewFile


Declaration

property OnPreviewFile: TIEFileDlgPreviewEvent;


Description

Occurs whenever a file is selected and needs to be previewed.

You can change the method that is used to load images by handling this event.


Example

// this is the default behavior
procedure TForm1.OnPreviewFile(Sender: TObject; Viewer: TObject; Filename: String; ParamsOnly: Boolean;
begin
  if ParamsOnly then
    (Viewer as TImageEnView).IO.ParamsFromFile(Filename)
  else
  if Viewer is TImageEnView then
    (Viewer as TImageEnView).IO.LoadFromFileAuto(Filename)
  else
  if Viewer is TImageEnMView then
    (Viewer as TImageEnMView).LoadFromFileOnDemand(Filename);
end;