Export (0) Print
Expand All

GraphicsPath Class

Represents a series of connected lines and curves. This class cannot be inherited.

For a list of all members of this type, see GraphicsPath Members.


[Visual Basic]
NotInheritable Public Class GraphicsPath
   Inherits MarshalByRefObject
   Implements ICloneable, IDisposable
public sealed class GraphicsPath : MarshalByRefObject, ICloneable,
public __gc __sealed class GraphicsPath : public
   MarshalByRefObject, ICloneable, IDisposable
public class GraphicsPath extends MarshalByRefObject implements
   ICloneable, IDisposable

Thread Safety



Applications use paths to draw outlines of shapes, fill the interiors of shapes, and create clipping regions. The graphics engine maintains the coordinates of geometric shapes in a path in world coordinate space.

A path may be composed of any number of figures (subpaths). Each figure is either composed of a sequence of connected lines and curves or a geometric shape primitive. The starting point of a figure is the first point in the sequence of connected lines and curves. The ending point is the last point in the sequence. The starting and ending points of a geometric shape primitive are defined by the primitive specification.

A figure that consists of a sequence of connected lines and curves (whose starting and ending points may be coincident) is an open figure, unless it is closed explicitly. A figure can be closed explicitly, by using the CloseFigure method, which closes the current figure by connecting a line from the ending point to the starting point. A figure that consists of a geometric shape primitive is a closed figure.

For purposes of filling and clipping (for example, if a path is rendered using Graphics.FillPath), all open figures are closed by adding a line from the figure's first point to its last point.

A new figure is implicitly started when a path is created or when a figure is closed. A new figure is explicitly when the StartFigure method is called.

When a geometric shape primitive is added to a path, it adds a figure containing the geometric shape, and also implicitly starts a new figure. Consequently, there is always a current figure in a path. When lines and curves are added to a path, an implicit line is added as needed to connect the ending point of the current figure to the starting point of the new lines and curves to form a sequence of connected lines and curves.

A figure has a direction that describes how line and curve segments are traced between the starting point and the ending point. The direction is defined in the order that lines and curves are added to a figure, or is defined by the geometric shape primitive. The direction is used in determining the path interiors for clipping and fill.


Namespace: System.Drawing.Drawing2D


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

See Also

GraphicsPath Members | System.Drawing.Drawing2D Namespace

© 2014 Microsoft