ImageEn, unit iemview

TImageEnMView.ImageWidth

TImageEnMView.ImageWidth


Declaration

property ImageWidth[idx: Integer]: Integer;


Description

ImageWidth and ImageHeight return the dimensions of the image, idx.

Note: If images are being loaded on demand, then the image dimensions will not be valid until the image is loaded. Either use the OnImageLoaded to delay until the image is ready, or force loading of the image by using EnsureImageLoaded


Example

// Display the image size below the thumbnail
// Ensure you have set the BottomGap property
procedure TForm1.ImageEnMView1ImageDraw(Sender: TObject; idx: Integer; Left, Top: Integer; Canvas: TCanvas);
begin
  Canvas.Font.Height := 15;
  Canvas.Font.Color := clWhite;
  Canvas.TextOut(Left,
                 Top + ImageEnMView1.ThumbHeight - ImageEnMView1.BottomGap + 2,
                 IntToStr(ImageEnMView1.ImageWidth[idx]) + 'x' + IntToStr(ImageEnMView1.ImageHeight[idx]));
end;