This documentation is archived and is not being maintained.
Graphics.DrawBezier Method
.NET Framework 1.1
Draws a Bzier spline defined by four Point structures.
Overload List
Draws a Bzier spline defined by four Point structures.
[Visual Basic] Overloads Public Sub DrawBezier(Pen, Point, Point, Point, Point)
[C#] public void DrawBezier(Pen, Point, Point, Point, Point);
[C++] public: void DrawBezier(Pen*, Point, Point, Point, Point);
[JScript] public function DrawBezier(Pen, Point, Point, Point, Point);
Draws a Bzier spline defined by four PointF structures.
[Visual Basic] Overloads Public Sub DrawBezier(Pen, PointF, PointF, PointF, PointF)
[C#] public void DrawBezier(Pen, PointF, PointF, PointF, PointF);
[C++] public: void DrawBezier(Pen*, PointF, PointF, PointF, PointF);
[JScript] public function DrawBezier(Pen, PointF, PointF, PointF, PointF);
Draws a Bzier spline defined by four ordered pairs of coordinates that represent points.
[Visual Basic] Overloads Public Sub DrawBezier(Pen, Single, Single, Single, Single, Single, Single, Single, Single)
[C#] public void DrawBezier(Pen, float, float, float, float, float, float, float, float);
[C++] public: void DrawBezier(Pen*, float, float, float, float, float, float, float, float);
[JScript] public function DrawBezier(Pen, float, float, float, float, float, float, float, float);
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 coordinates of the start, end, and two control points for the curve.
- Draws the Bzier curve to the screen.
[Visual Basic, C#] Note This example shows how to use one of the overloaded versions of DrawBezier. For other examples that might be available, see the individual overload topics.
[Visual Basic] ' Begin Example03. Public Sub DrawBezierFloat(e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create coordinates of points for curve. Dim startX As Single = 100F Dim startY As Single = 100F Dim controlX1 As Single = 200F Dim controlY1 As Single = 10F Dim controlX2 As Single = 350F Dim controlY2 As Single = 50F Dim endX As Single = 500F Dim endY As Single = 100F ' Draw arc to screen. e.Graphics.DrawBezier(blackPen, startX, startY, controlX1, _ controlY1, controlX2, controlY2, endX, endY) End Sub [C#] public void DrawBezierFloat(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create coordinates of points for curve. float startX = 100.0F; float startY = 100.0F; float controlX1 = 200.0F; float controlY1 = 10.0F; float controlX2 = 350.0F; float controlY2 = 50.0F; float endX = 500.0F; float endY = 100.0F; // Draw arc to screen. e.Graphics.DrawBezier(blackPen, startX, startY, controlX1, controlY1, controlX2, controlY2, endX, endY); }
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
See Also
Graphics Class | Graphics Members | System.Drawing Namespace
Show: