ImageEn, unit imageenproc

TImageEnProc.GetReSel

TImageEnProc.GetReSel

Declaration

function GetReSel(out SelX1, SelY1, SelX2, SelY2: Integer; var mask: TIEMask): Boolean; overload;
function GetReSel(out SelX1, SelY1, SelX2, SelY2: Integer; var PolySel: PPointArray; var PolySelCount: Integer; var mask: TIEMask): Boolean; overload;

Description

Return the selected area of the attached TImageEnView or SelectedRect. Returns False if there isn't a selected area.

If a TImageEnView is not attached and Selected = False, it returns the full rect of the bitmap (Result = False).
If TImageEnView.Selected is True, Result is True. Bounds come from TImageEnView.SelectionMask when it is non-empty; otherwise from SelX1..SelY2 (vectorized / in-progress selection can leave the mask empty). Degenerate empty-mask bounds fall back to the full image. Callers that require a raster mask should also check Assigned(Mask) and not Mask.IsEmpty.

Note:
This method is the same as accessing TImageEnView.SelectionMask, but returns more information
The pixels of SelX2, SelY2 are excluded from processing, e.g. if an entire 100x100 image is selected, SelX1, SelY1, SelX2, SelY2 will 0,0,100,100

See Also

TImageEnView.SelectionMask
SelectedRect
Selected