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
// Enlarge the selection by ten pixels on all sides ImageEnView1.SelectionBase := iesbBitmap; ImageEnView1.Select( ImageEnView1.SelX1 - 10, ImageEnView1.SelY1 - 10, ImageEnView1.SelX2 - 10, ImageEnView1.SelY2 - 10 );
// Test if the image is blank (with 1% threshold and ignoring the border area) threshold := 1.0; // Allow 1% of image to be a different color borderPerc := 10; // Border area is 10% of width/height ImageEnView1.SelectionBase := iesbBitmap; ImageEnView1.Select( MulDiv( ImageEnView1.IEBitmap.Width, borderPerc, 100 ), MulDiv( ImageEnView1.IEBitmap.Height, borderPerc, 100 ), MulDiv( ImageEnView1.IEBitmap.Width, 100 - borderPerc, 100 ), MulDiv( ImageEnView1.IEBitmap.Height, 100 - borderPerc, 100 )); if ImageEnView1.Proc.GetDominantColor(cl) >= 100 - threshold then ShowMessage('Image is blank!') else ShowMessage('Image is NOT blank!'); ImageEnView1.Deselect();
// 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;
// Subtract a circular area from a rectangular selection ImageEnView1.Select( 42, 133, 326, 214, iespReplace ); ImageEnView1.SelectEllipse( 145, 130, 155, 170, iespSubtract );