PathAddPoint(Single, Single) Method

Adds a point 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 AddPoint(
	float x,
	float y
)

Parameters

x  Single
The x-coordinate of the point to add.
y  Single
The y-coordinate of the point to add.

Return Value

Path
This Path instance.

Remarks

If the current figure is empty, the added point will be the starting point of the figure. Otherwise, the added point will be connected to the last point of the figure.

When the Path is filled, the figures require at least 3 non-collinear points to be rendered. When the Path is drawn, even a single point is rendered. If the Pen.Width is 1, it means drawing a single pixel, in which case it's much faster to use the IWritableBitmapData.SetColor32 method instead.

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