ImageEn, unit imageenview

TImageEnView.SelectEllipse

TImageEnView.SelectEllipse


Declaration

procedure SelectEllipse(CenterX, CenterY, Width, Height: Integer; Op: TIESelOp = iespReplace);


Description

Makes an elliptical selection, centered at CenterX and CenterY, and with size specified by Width and Height.
Op specifies whether to add a new selection (iespAdd) or replace the current one (iespReplace).

The style of selection are specified by:
SelColor1
SelColor2
SetSelectionGripStyle

Note: SelectEllipse creates a "vectorized" selection (the selection will be made up of a series of lines and can be accessed via PolySel)


Examples

// Select 20x20 ellipse centered at 100, 100
ImageEnView1.SelectEllipse( 100, 100, 20, 20 );

// Make circular selection of entire image and crop
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.SelectEllipse(ImageEnView1.IEBitmap.Width div 2,
                           ImageEnView1.IEBitmap.Height div 2,
                           ImageEnView1.IEBitmap.Width,
                           ImageEnView1.IEBitmap.Height);
ImageEnView1.Proc.CropSel();

// Subtract a circular area from a rectangular selection
ImageEnView1.Select( 42, 133, 326, 214, iespReplace );
ImageEnView1.SelectEllipse( 145, 130, 155, 170, iespSubtract );




// Convert existing (e.g. rectangular) selection to circular
var
  w, h: Integer;
begin
  if ImageEnView1.Selected then
  begin
    w := ImageEnView1.SelX2 - ImageEnView1.SelX1;
    h := ImageEnView1.SelY2 - ImageEnView1.SelY1;
    ImageEnView1.SelectEllipse( ImageEnView1.SelX1 + w div 2,
                                ImageEnView1.SelY1 + h div 2,
                                w, h );
  end;
end;


Other Selection Methods

Select
SelectMagicWand
SelectChromaKey
SelectRoundRect
SelectShape


See Also

InvertSelection
Deselect