ImageEn, unit iemview

TImageEnMView.OnWrongImage

TImageEnMView.OnWrongImage


Declaration


property OnWrongImage: TIEWrongImageEvent;


Description


Occurs whenever TImageEnMView cannot load the image specified by the ImageFileName property, for instance when the file is corrupt or of an unrecognized format.

You can specify an alternative bitmap to display by changing the OutBitmap property.


Example


Procedure MyForm1OnWrongImage(Sender: TObject; OutBitmap: TIEBitmap; idx: Integer; var Handled: Boolean);
Var
   io: TImageEnIO;
begin
   io := TImageEnIO.CreateFromBitmap(OutBitmap);
   io.LoadFromFile('error_image.bmp');
   io.Free;
   Handled := True;
end;