ImageEn, unit iexLayers

TIEPolylineLayer.AddPoint

TIEPolylineLayer.AddPoint


Declaration

procedure AddPoint(X, Y: integer; PointBase: TIEPointBase = iepbRange; SnapAngles: Boolean = False); overload;
procedure AddPoint(pt: TPoint; PointBase: TIEPointBase = iepbRange; SnapAngles: Boolean = False); overload;


Description

Add a point to the end of a polyline.
Each point of the polyline is represented by an x and y value in the range 0 to 1000. Where (0, 0) is the top-left pixel of the layer and (1000, 1000) is the bottom-right. Values less than 0 or more than 1000 will increase the size of the layer.

Parameter Description
X, Y The point to add
PointBase What base units point values are specified in
SnapAngles Set to true to adjust the angle to ensure it aligns with LayersRotateStep (e.g. force it to 45 deg. steps)

Note: You specify point($FFFFF, $FFFFF) to insert a break in the array (to create multiple polylines/polygons), or point($FFFEE, $FFFEE) if the break should close the polyline (to create a polygon)


Examples

// Draw a polyline
With TIEPolylineLayer( ImageEnView1.CurrentLayer ) do
begin
  ClearAllPoints();
  AddPoint( 500, 0 );
  AddPoint( 1000, 1000 );
  AddPoint( 0, 1000 );
end;
ImageEnView1.Update();



// Draw a triangle polygon
With TIEPolylineLayer( ImageEnView1.CurrentLayer ) do
begin
  ClearAllPoints();
  AddPoint( 500, 0 );
  AddPoint( 1000, 1000 );
  AddPoint( 0, 1000 );
  PolylineClosed := True;
end;
ImageEnView1.Update();



// Draw a fat blue N
ImageEnView1.LayersAdd( ielkPolyline, 100, 100, 200, 400 );
With TIEPolylineLayer( ImageEnView1.CurrentLayer ) do
begin
  AddPoint( 0, 1000 );
  AddPoint( 0, 0 );
  AddPoint( 1000, 1000 );
  AddPoint( 1000, 0 );
  LineWidth := 20;
  LineColor := clBlue;
  PolylineClosed := False;
end;
ImageEnView1.Update();

// Add a point that will double the width of the layer
TIEPolylineLayer( ImageEnView1.CurrentLayer ).AddPoint( 130, 2000 );


// Draw a pink balloon
ImageEnView1.LayersAdd( ielkPolyline, 100, 100, 600, 800 );
With TIEPolylineLayer( ImageEnView1.CurrentLayer ) do
begin
  AddPoint( 500, 500 );
  AddCurvePoints( 0.95, Point( 500, 0 ));
  AddCurvePoints( 0.95, Point( 500, 500 ));
  AddPoint($FFFEE, $FFFEE);     // End shape and close polyline
  AddPoint( 500, 500 );
  AddPoint( 520, 517 );
  AddPoint( 480, 517 );
  AddPoint($FFFEE, $FFFEE);     // End shape and close polyline
  AddPoint( 500, 517 );
  AddCurvePoints( 3, Point( 500, 690 ));
  AddCurvePoints( -3, Point( 510, 850 ));
  AddCurvePoints( 3, Point( 500, 1000 ));
  AddPoint($FFFFF, $FFFFF);     // End polyline (optional at end)

  LineWidth := 2;
  FillColor := $00921CF0;
  PolylineClosed := False;
end;
ImageEnView1.Update();




See Also

 InsertPoint
 RemovePoint
 SetPoint
 SetPoints
 Points