PathAddBezier(Single, Single, Single, Single, Single, Single, Single, Single) Method

Adds a cubic Bézier curve to this Path.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public Path AddBezier(
	float x1,
	float y1,
	float x2,
	float y2,
	float x3,
	float y3,
	float x4,
	float y4
)

Parameters

x1  Single
The x-coordinate of the starting point of the Bézier curve.
y1  Single
The y-coordinate of the starting point of the Bézier curve.
x2  Single
The x-coordinate of the first control point of the Bézier curve.
y2  Single
The y-coordinate of the first control point of the Bézier curve.
x3  Single
The x-coordinate of the second control point of the Bézier curve.
y3  Single
The y-coordinate of the second control point of the Bézier curve.
x4  Single
The x-coordinate of the end point of the Bézier curve.
y4  Single
The y-coordinate of the end point of the Bézier curve.

Return Value

Path
This Path instance.

Remarks

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

This method adds a cubic Bézier curve defined by four points: the starting point, two control points, and the end point. To add a quadratic Bézier curve, you can use the AddQuadraticCurve method. Similarly, to add a conic curve, you can use the AddConicCurve method. In fact, both will transform the curve into a cubic Bézier curve internally.

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