Just look in the events in the help file:
// 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;
Declaration
property OnImageDraw2: TIEImageDraw2Event;
Description
Occurs whenever an image is painted. Same as OnImageDraw but includes ImageRect to return the thumbnail rectangle.
Here is some code that draws a rect around the thumbnail if the thumbnail height is > thumbnail height (Portrait).
procedure TForm1.ImageEnMView1ImageDraw(Sender: TObject; idx, Left, Top: Integer; Canvas: TCanvas);
{Draw a green rect if the thumbnail is portrait}
var
iWidth: integer;
iHeight: integer;
begin
iWidth := ImageEnMView1.ImageOriginalWidth[idx];
iHeight := ImageEnMView1.ImageOriginalHeight[idx];
if iHeight > iWidth then
with Canvas do
begin
Pen.Color := TRGB2TColor(CreateRGB(0, 255, 0));
Pen.Width := 4;
Brush.Style := bsClear;
Canvas.Rectangle(Left, Top, Left + ImageEnMView1.ThumbWidth, Top + ImageEnMView1.ThumbHeight);
end;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development