This documentation is archived and is not being maintained.

Graphics.DrawBeziers Method

Draws a series of Bzier splines from an array of Point structures.

Overload List

Draws a series of Bzier splines from an array of Point structures.

[Visual Basic] Overloads Public Sub DrawBeziers(Pen, Point())
[C#] public void DrawBeziers(Pen, Point[]);
[C++] public: void DrawBeziers(Pen*, Point[]);
[JScript] public function DrawBeziers(Pen, Point[]);

Draws a series of Bzier splines from an array of PointF structures.

[Visual Basic] Overloads Public Sub DrawBeziers(Pen, PointF())
[C#] public void DrawBeziers(Pen, PointF[]);
[C++] public: void DrawBeziers(Pen*, PointF[]);
[JScript] public function DrawBeziers(Pen, PointF[]);

Example

[Visual Basic, C#] The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:

  • Creates a black pen.
  • Creates the start, end, and two control points for a first curve and end point and two control points for a second curve.
  • Draws the successive Bzier curves to the screen.
[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of DrawBeziers. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub DrawBeziersPointF(e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create points for curve.
Dim start As New PointF(100F, 100F)
Dim control1 As New PointF(200F, 10F)
Dim control2 As New PointF(350F, 50F)
Dim end1 As New PointF(500F, 100F)
Dim control3 As New PointF(600F, 150F)
Dim control4 As New PointF(650F, 250F)
Dim end2 As New PointF(500F, 300F)
Dim bezierPoints As PointF() =  {start, control1, control2, _
end1, control3, control4, end2}
' Draw arc to screen.
e.Graphics.DrawBeziers(blackPen, bezierPoints)
End Sub
        
[C#] 
public void DrawBeziersPointF(PaintEventArgs e)
{
// Create pen.
Pen blackPen = new Pen(Color.Black, 3);
// Create points for curve.
PointF start = new PointF(100.0F, 100.0F);
PointF control1 = new PointF(200.0F, 10.0F);
PointF control2 = new PointF(350.0F, 50.0F);
PointF end1 = new PointF(500.0F, 100.0F);
PointF control3 = new PointF(600.0F, 150.0F);
PointF control4 = new PointF(650.0F, 250.0F);
PointF end2 = new PointF(500.0F, 300.0F);
PointF[] bezierPoints =
{
start, control1, control2, end1,
control3, control4, end2
};
// Draw arc to screen.
e.Graphics.DrawBeziers(blackPen, bezierPoints);
}
        

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Graphics Class | Graphics Members | System.Drawing Namespace

Show: