ImageEn, unit imageenview

TImageEnView.Select

TImageEnView.Select


Declaration


procedure Select(x1, y1, x2, y2: integer; Op: TIESelOp = iespReplace); virtual;


Description


Selects a portion of the image.
The selected area will be outlined with an animated rectangle.
If SelectionBase is iesbClientArea (default) all coordinates depend on actual zoom and scrolling.
If SelectionBase is iesbBitmap, all coordinates refer to bitmap pixels.

Parameter Description
x1 Top-left horizontal position
y1 Top-left vertical position
x2 Bottom-right horizontal position. Last column not selected
y2 Bottom-right vertical position. Last row not selected
Op Selection operation (add or replace selection). If Op is iespReplace, Select replaces all previous selections. If Op is iespAdd, Select adds a new selection


x2, y2 represent the right/bottom margin (not selected). To select an area of 1x1 pixels we need to select using 0,0,1,1 (the column 1 and the row 1 aren't selected).


Examples


// Increase contrast of bitmap rectangle (0,0,49,49)
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.Select(0, 0, 50, 50);
ImageEnView1.Proc.Contrast(10);
ImageEnView1.Deselect;

// Enlarge the selection by ten pixels on all sides
With ImageEnView1 do
begin
  SelectionBase := iesbBitmap;
  Select( SelX1 - 10, SelY1 - 10, SelX2 - 10, SelY2 - 10 );
End;

// Select whole image and allow user to deselect circular regions
With ImageEnView1 do
begin
  SelectionBase := iesbBitmap;
  Select( 0, 0, IEBitmap.Width, IEBitmap.Height );
  ShiftKeyLock := [ iessCtrl_SubFromSel ];
  MouseInteractGeneral := [ miSelectCircle ];
end;


See Also


- SelectEllipse
- SelectMagicWand
- SelectChromaKey
- SelectRoundRect
- InvertSelection
- Deselect
- SelX1
- SelY1
- SelX2
- SelY2