ImageEn, unit iemview

TImageEnMView.OnImageDraw2

TImageEnMView.OnImageDraw2


Declaration

property OnImageDraw2: TIEImageDraw2Event;


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.


Demo

Demo  Demos\Multi\CustomThumbs2\CustomThumbs2.dpr


Example

// Display the image index and sizes on bottom of the thumbnail
// Ensure you have set the BottomGap property
procedure TForm1.ImageEnMView1ImageDraw2(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;