This documentation is archived and is not being maintained.

GraphicsPath.StartFigure Method

Starts a new figure without closing the current figure. All subsequent points added to the path are added to this new figure.

Namespace:  System.Drawing.Drawing2D
Assembly:  System.Drawing (in System.Drawing.dll)

public void StartFigure()

The user must keep the original points if they are needed. The original points are converted to cubic Bézier control points internally, therefore there is no mechanism for returning the original points.

This method starts a new subpath in the path. Subpaths allow you to separate a path into sections and use the GraphicsPathIterator class to iterate through the subpaths.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, an OnPaint event object. The code performs the following actions:

  • Creates a path.

  • Adds two sets of figures. The first set of figures combines four primitives into two figures. The second set of figures combines the same four primitives (except that they are offset in the y-axis) into three figures.

  • Draws all the figures to the screen.

Notice the difference in the appearance between the two sets of figures.

public void StartFigureExample(PaintEventArgs e)

    // Create a GraphicsPath object.
    GraphicsPath myPath = new GraphicsPath();

    // First set of figures.
    myPath.AddArc(10, 10, 50, 50, 0, 270);
    myPath.AddLine(new Point(50, 0), new Point(100, 50));
    myPath.AddArc(50, 100, 75, 75, 0, 270);
    myPath.AddArc(100, 10, 50, 50, 0, 270);

    // Second set of figures.
    myPath.AddArc(10, 200, 50, 50, 0, 270);
    myPath.AddLine(new Point(60, 200), new Point(110, 250));
    myPath.AddArc(50, 300, 75, 75, 0, 270);
    myPath.AddArc(100, 200, 50, 50, 0, 270);

    // Draw the path to the screen.
    e.Graphics.DrawPath(new Pen(Color.Black), myPath);
// End StartFigureExample

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0