PathAddLine(Single, Single, Single, Single) 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: 9.1.1
C#
public Path AddLine(
	float x1,
	float y1,
	float x2,
	float y2
)

Parameters

x1  Single
The x-coordinate of the starting point of the line to add.
y1  Single
The y-coordinate of the starting point of the line to add.
x2  Single
The x-coordinate of the end point of the line to add.
y2  Single
The y-coordinate of 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