Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_Paths🞂TCustomPath🞂LineToMethod

TCustomPath.LineTo

Appends a straight line segment from the current position to a target coordinate.

Declarations ​

pascal
procedure LineTo(const X, Y: TFloat); overload;
procedure LineTo(const P: TFloatPoint); overload; virtual;
Overload Details

Overload 1 ​

pascal
procedure LineTo(const X, Y: TFloat); overload;

Appends a line segment to absolute coordinate (X, Y).

ParameterTypeDescription
X, YTFloatDestination X and Y coordinates.

Overload 2 ​

pascal
procedure LineTo(const P: TFloatPoint); overload; virtual;

Appends a line segment to absolute point P.

ParameterTypeDescription
PTFloatPointDestination point.

Description ​

LineTo appends a straight line segment connecting CurrentPoint to a specified absolute destination point and updates CurrentPoint to the target location.

Example ​

pascal
var
  Canvas: TCanvas32;
begin
  Canvas := TCanvas32.Create(MyBitmap);
  try
    Canvas.MoveTo(10.0, 10.0);
    Canvas.LineTo(200.0, 10.0);
    Canvas.LineTo(FloatPoint(200.0, 150.0));
    Canvas.EndPath(False);
  finally
    Canvas.Free;
  end;
end;