ImageEn, unit imageenview

TImageEnView.SelectedRect

TImageEnView.SelectedRect


Declaration

property SelectedRect: TIERectangle;


Description

Returns current selected rectangle. If no selected exists returns the whole image rectangle.
The coordinate has the same dimensions of the bitmap (i.e. it is not affected by Zoom and ViewX, ViewY values).
You can programatically make a selection using the Select method.

Read-only


Example

// Zoom into the selected area of the image
procedure TMainForm.Button1Click(Sender: TObject);
var
  sel: TIERectangle;
begin
  if ImageEnView1.Selected then
  begin
    sel := ImageEnView1.SelectedRect;
    ImageEnView1.VisibleBitmapRect := Rect( sel.x, sel.y, sel.x + sel.width, sel.y + sel.height );
  end;
end;