ImageEn, unit iemview

TImageEnMView.OnImageDraw

TImageEnMView.OnImageDraw


Declaration


property OnImageDraw: TIEImageDrawEvent;


Description


Occurs whenever an image is painted.

Note: OnImageDraw and OnImageDraw2 are identical, except that OnImageDraw2 includes a ThumbRect parameter to return the thumbnail rectangle.


Example


// Display the image index and sizes on bottom of the thumbnail
// Ensure you have set the BottomGap property
procedure TForm1.ImageEnMView1ImageDraw(Sender: TObject; idx: Integer; Left, Top: Integer; Canvas: TCanvas);
begin
  with canvas do
  begin
    Font.Height := 15;
    Font.Color := clWhite;
    TextOut(Left, Top + imageenmview1.ThumbHeight - imageenmview1.bottomgap + 2, IntToStr(idx));
    TextOut(Left, Top, IntToStr(imageenmview1.ImageWidth[idx]) + 'x' + IntToStr(imageenmview1.ImageHeight[idx]));
  end;
end;