Graphics.DrawBezier Method (Pen, Single, Single, Single, Single, Single, Single, Single, Single)

Draws a Bezier spline defined by four ordered pairs of coordinates that represent points.

Namespace: Aurigma.GraphicsMill.AdvancedDrawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void DrawBezier(
	Pen pen,
	float x,
	float y,
	float controlX1,
	float controlY1,
	float controlX2,
	float controlY2,
	float endX,
	float endY
)

Parameters

pen

Type: Aurigma.GraphicsMill.AdvancedDrawing.Pen

A Pen that determines the color, width, and style of the curve.
x

Type: System.Single

The x-coordinate of the starting point of the curve.
y

Type: System.Single

The y-coordinate of the starting point of the curve.
controlX1

Type: System.Single

The x-coordinate of the first control point for the curve.
controlY1

Type: System.Single

The y-coordinate of the first control point for the curve.
controlX2

Type: System.Single

The x-coordinate of the second control point for the curve.
controlY2

Type: System.Single

The y-coordinate of the second control point for the curve.
endX

Type: System.Single

The x-coordinate of the ending point of the curve.
endY

Type: System.Single

The y-coordinate of the ending point of the curve.

Remarks

A Bezier spline is defined with four points: first and last point specify beginning and end of the curve, second and third points specify so-called control points. The control points act as magnets, pulling the curve in certain directions to influence the way the Bezier spline bends.

Examples

C#
using (var bitmap = new Bitmap(160, 120, PixelFormat.Format24bppRgb, RgbColor.White))
using (var graphics = bitmap.GetAdvancedGraphics()) 
{
    graphics.DrawBezier(new Pen(RgbColor.Black), 10, 60, 40, 20, 70, 60, 100, 20); 
    bitmap.Save(@"Images\Output\out.png");
}

See Also

Reference

Manual