PathAddLine(PointF, PointF) Method

Adds a line to the current figure of this Path instance.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public Path AddLine(
	PointF p1,
	PointF p2
)

Parameters

p1  PointF
The starting point of the line to add.
p2  PointF
The end point of the line to add.

Return Value

Path
This Path instance.

Remarks

If the current figure is not empty or closed, the added line will be connected to the last point of the figure.

When the Path is filled, a single line is not rendered. When the Path is drawn, the right/bottom values of the coordinates are inclusive, so even a single pixel line is rendered.

The parameters are not validated here, but in the moment of drawing the coordinates of the possibly transformed path points must fall into the bounds of an int value; otherwise, an OverflowException will be thrown.

See Also