TIEPolylineLayer.GetPoints
Declaration
function GetPoints(index: integer; PointBase: TIEPointBase = iepbRange): TDPoint; overload;
procedure GetPoints(var pts: TIEDPointArray; Base: TIEPointBase = iepbRange); overload;
procedure GetPoints(var pts: TIEArrayOfTPoint; Base: TIEPointBase = iepbRange); overload;
procedure GetPoints(var pts: TIEDPointArray; fmts: TIEPointFormatArray; Base: TIEPointBase = iepbRange); overload;
Description
Get a point of the polyline.
with TIEAngleLayer( ImageEnView1.CurrentLayer ) do
s := Format('(%d, %d) (%d, %d) (%d, %d)', [ GetPoints( 0, iepbBitmap ).X, GetPoints( 0, iepbBitmap ).Y,
GetPoints( 1, iepbBitmap ).X, GetPoints( 1, iepbBitmap ).Y,
GetPoints( 2, iepbBitmap ).X, GetPoints( 2, iepbBitmap ).Y ]);
ShowMessage(s);
// Convert the current polyline layer to a polygon selection
ImageEnView1.BeginSelect();
ImageEnView1.Deselect();
ImageEnView1.SelectionBase := iesbClientArea;
plyr := TIEPolylineLayer( ImageEnView1.CurrentLayer );
ImageEnView1.LayersCurrent := 0; // Selecting layer 0
for i := 0 to plyr.PointCount - 1 do
begin
xx := Round( plyr.GetPoints( i, iepbClientArea).x );
yy := Round( plyr.GetPoints( i, iepbClientArea).y );
ImageEnView1.AddSelPoint(xx, yy);
end;
ImageEnView1.EndSelect();
ImageEnView1.LayersRemove( plyr.LayerIndex );
// Add all the points of one polyline to another
var
plyr1, plyr2: TIEPolylineLayer;
i: Integer;
pt: TDPoint;
begin
plyr1 := TIEPolylineLayer( ImageEnView1.Layers[1] );
plyr2 := TIEPolylineLayer( ImageEnView1.Layers[2] );
for i := 0 to plyr2.PointCount - 1 do
begin
pt := plyr2.GetPoints( i, iepbBitmap );
plyr1.AddPoint( Round( pt.X ), Round( pt.Y ), iepbBitmap );
end;
ImageEnView1.LayersRemove( 2 );
ImageEnView1.Update();
end;