Export (0) Print
Expand All

GraphicsPath class

Applies to: desktop apps only

A GraphicsPath object stores a sequence of lines, curves, and shapes. You can draw the entire sequence by calling the DrawPath method of a Graphics object. You can partition the sequence of lines, curves, and shapes into figures, and with the help of a GraphicsPathIterator object, you can draw selected figures. You can also place markers in the sequence, so that you can draw selected portions of the path.

Members

The GraphicsPath class inherits from GdiplusBase. GraphicsPath also has these types of members:

Constructors

The GraphicsPath class has these constructors.

ConstructorDescription
GraphicsPath::GraphicsPath(FillMode)

Creates a GraphicsPath::GraphicsPath object and initializes the fill mode. This is the default constructor.

GraphicsPath::GraphicsPath(Point*,BYTE*,INT,FillMode)

Creates a GraphicsPath::GraphicsPath object based on an array of points, an array of types, and a fill mode.

GraphicsPath::GraphicsPath(PointF*,BYTE*,INT,FillMode)

Creates a GraphicsPath::GraphicsPath object based on an array of points, an array of types, and a fill mode.

 

Methods

The GraphicsPath class has these methods.

MethodDescription
GraphicsPath::AddArc(INT,INT,INT,INT,REAL,REAL)

The GraphicsPath::AddArc method adds an elliptical arc to the current figure of this path.

GraphicsPath::AddArc(REAL,REAL,REAL,REAL,REAL,REAL)

The GraphicsPath::AddArc method adds an elliptical arc to the current figure of this path.

GraphicsPath::AddArc(Rect&,REAL,REAL)

The GraphicsPath::AddArc method adds an elliptical arc to the current figure of this path.

GraphicsPath::AddArc(RectF&,REAL,REAL)

The GraphicsPath::AddArc method adds an elliptical arc to the current figure of this path.

GraphicsPath::AddBezier(INT,INT,INT,INT,INT,INT,INT,INT)

The GraphicsPath::AddBezier method adds a Bézier spline to the current figure of this path.

GraphicsPath::AddBezier(Point&,Point&,Point&,Point&)

The GraphicsPath::AddBezier method adds a Bézier spline to the current figure of this path.

GraphicsPath::AddBezier(PointF&,PointF&,PointF&,PointF&)

The GraphicsPath::AddBezier method adds a Bézier spline to the current figure of this path.

GraphicsPath::AddBezier(REAL,REAL,REAL,REAL,REAL,REAL,REAL,REAL)

The GraphicsPath::AddBezier method adds a Bézier spline to the current figure of this path.

GraphicsPath::AddBeziers(Point*,INT)

The GraphicsPath::AddBeziers method adds a sequence of connected Bézier splines to the current figure of this path.

GraphicsPath::AddBeziers(PointF*,INT)

The GraphicsPath::AddBeziers method adds a sequence of connected Bézier splines to the current figure of this path.

GraphicsPath::AddClosedCurve(Point*,INT)

The GraphicsPath::AddClosedCurve method adds a closed cardinal spline to this path.

GraphicsPath::AddClosedCurve(Point*,INT,REAL)

The GraphicsPath::AddClosedCurve method adds a closed cardinal spline to this path.

GraphicsPath::AddClosedCurve(PointF*,INT)

The GraphicsPath::AddClosedCurve method adds a closed cardinal spline to this path.

GraphicsPath::AddClosedCurve(PointF*,INT,REAL)

The GraphicsPath::AddClosedCurve method adds a closed cardinal spline to this path.

GraphicsPath::AddCurve(Point*,INT)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddCurve(Point*,INT,INT,INT,REAL)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddCurve(Point*,INT,REAL)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddCurve(PointF*,INT)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddCurve(PointF*,INT,INT,INT,REAL)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddCurve(PointF*,INT,REAL)

The GraphicsPath::AddCurve method adds a cardinal spline to the current figure of this path.

GraphicsPath::AddEllipse(INT,INT,INT,INT)

The GraphicsPath::AddEllipse method adds an ellipse to this path.

GraphicsPath::AddEllipse(REAL,REAL,REAL,REAL)

The GraphicsPath::AddEllipse method adds an ellipse to this path.

GraphicsPath::AddEllipse(Rect&)

The GraphicsPath::AddEllipse method adds an ellipse to this path.

GraphicsPath::AddEllipse(RectF&)

The GraphicsPath::AddEllipse method adds an ellipse to this path.

GraphicsPath::AddLine(INT,INT,INT,INT)

The GraphicsPath::AddLine method adds a line to the current figure of this path.

GraphicsPath::AddLine(Point&,Point&)

The GraphicsPath::AddLine method adds a line to the current figure of this path.

GraphicsPath::AddLine(PointF&,PointF&)

The GraphicsPath::AddLine method adds a line to the current figure of this path.

GraphicsPath::AddLine(REAL,REAL,REAL,REAL)

The GraphicsPath::AddLine method adds a line to the current figure of this path.

GraphicsPath::AddLines(Point*,INT)

The GraphicsPath::AddLines method adds a sequence of connected lines to the current figure of this path.

GraphicsPath::AddLines(PointF*,INT)

The GraphicsPath::AddLines method adds a sequence of connected lines to the current figure of this path.

GraphicsPath::AddPath

The GraphicsPath::AddPath method adds a path to this path.

GraphicsPath::AddPie(INT,INT,INT,INT,REAL,REAL)

The GraphicsPath::AddPie method adds a pie to this path. An arc is a portion of an ellipse, and a pie is a portion of the area enclosed by an ellipse. A pie is bounded by an arc and two lines (edges) that go from the center of the ellipse to the endpoints of the arc.

GraphicsPath::AddPie(REAL,REAL,REAL,REAL,REAL,REAL)

The GraphicsPath::AddPie method adds a pie to this path. An arc is a portion of an ellipse, and a pie is a portion of the area enclosed by an ellipse. A pie is bounded by an arc and two lines (edges) that go from the center of the ellipse to the endpoints of the arc.

GraphicsPath::AddPie(Rect&,REAL,REAL)

The GraphicsPath::AddPie method adds a pie to this path. An arc is a portion of an ellipse, and a pie is a portion of the area enclosed by an ellipse. A pie is bounded by an arc and two lines (edges) that go from the center of the ellipse to the endpoints of the arc.

GraphicsPath::AddPie(RectF&,REAL,REAL)

The GraphicsPath::AddPie method adds a pie to this path. An arc is a portion of an ellipse, and a pie is a portion of the area enclosed by an ellipse. A pie is bounded by an arc and two lines (edges) that go from the center of the ellipse to the endpoints of the arc.

GraphicsPath::AddPolygon(Point*,INT)

The GraphicsPath::AddPolygon method adds a polygon to this path.

GraphicsPath::AddPolygon(PointF*,INT)

The GraphicsPath::AddPolygon method adds a polygon to this path.

GraphicsPath::AddRectangle(Rect&)

The GraphicsPath::AddRectangle method adds a rectangle to this path.

GraphicsPath::AddRectangle(RectF&)

The GraphicsPath::AddRectangle method adds a rectangle to this path.

GraphicsPath::AddRectangles(Rect*,INT)

The GraphicsPath::AddRectangles method adds a sequence of rectangles to this path

GraphicsPath::AddRectangles(RectF*,INT)

The GraphicsPath::AddRectangles method adds a sequence of rectangles to this path.

GraphicsPath::AddString(WCHAR*,INT,FontFamily*,INT,REAL,Point&,StringFormat*)

The GraphicsPath::AddString method adds the outlines of a string to this path.

GraphicsPath::AddString(WCHAR*,INT,FontFamily*,INT,REAL,PointF&,StringFormat*)

The GraphicsPath::AddString method adds the outline of a string to this path.

GraphicsPath::AddString(WCHAR*,INT,FontFamily*,INT,REAL,Rect&,StringFormat*)

The GraphicsPath::AddString method adds the outline of a string to this path.

GraphicsPath::AddString(WCHAR*,INT,FontFamily*,INT,REAL,RectF&,StringFormat*)

The GraphicsPath::AddString method adds the outline of a string to this path.

GraphicsPath::ClearMarkers

The GraphicsPath::ClearMarkers method clears the markers from this path.

GraphicsPath::Clone

The GraphicsPath::Clone method creates a new GraphicsPath object, and initializes it with the contents of this GraphicsPath object.

GraphicsPath::CloseAllFigures

The GraphicsPath::CloseAllFigures method closes all open figures in this path.

GraphicsPath::CloseFigure

The GraphicsPath::CloseFigure method closes the current figure of this path.

GraphicsPath::Flatten

The GraphicsPath::Flatten method applies a transformation to this path and converts each curve in the path to a sequence of connected lines.

GraphicsPath::GetBounds(Rect*,Matrix*,Pen*)

The GraphicsPath::GetBounds method gets a bounding rectangle for this path.

GraphicsPath::GetBounds(RectF*,Matrix*,Pen*)

The GraphicsPath::GetBounds method gets a bounding rectangle for this path.

GraphicsPath::GetFillMode

The GraphicsPath::GetFillMode method gets the fill mode of this path.

GraphicsPath::GetLastPoint

The GraphicsPath::GetLastPoint method gets the ending point of the last figure in this path.

GraphicsPath::GetLastStatus

The GraphicsPath::GetLastStatus method returns a value that indicates the nature of this GraphicsPath object's most recent method failure.

GraphicsPath::GetPathData

The GraphicsPath::GetPathData method gets an array of points and an array of point types from this path. Together, these two arrays define the lines, curves, figures, and markers of this path.

GraphicsPath::GetPathPoints(Point*,INT)

The GraphicsPath::GetPathPoints method gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

GraphicsPath::GetPathPoints(PointF*,INT)

The GraphicsPath::GetPathPoints method gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

GraphicsPath::GetPathTypes

The GraphicsPath::GetPathTypes method gets this path's array of point types.

GraphicsPath::GetPointCount

The GraphicsPath::GetPointCount method gets the number of points in this path's array of data points. This is the same as the number of types in the path's array of point types.

GraphicsPath::IsOutlineVisible(INT,INT,Pen*,Graphics*)

The GraphicsPath::IsOutlineVisible method determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

GraphicsPath::IsOutlineVisible(Point&,Pen*,Graphics*)

The GraphicsPath::IsOutlineVisible method determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

GraphicsPath::IsOutlineVisible(PointF&,Pen*,Graphics*)

The GraphicsPath::IsOutlineVisible method determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

GraphicsPath::IsOutlineVisible(REAL,REAL,Pen*,Graphics*)

The GraphicsPath::IsOutlineVisible method determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

GraphicsPath::IsVisible(INT,INT,Graphics*)

The GraphicsPath::IsVisible method determines whether a specified point lies in the area that is filled when this path is filled by a specified Graphics object.

GraphicsPath::IsVisible(Point&,Graphics*)

The GraphicsPath::IsVisible method determines whether a specified point lies in the area that is filled when this path is filled by a specified Graphics object.

GraphicsPath::IsVisible(PointF&,Graphics*)

The GraphicsPath::IsVisible method determines whether a specified point lies in the area that is filled when this path is filled by a specified Graphics object.

GraphicsPath::IsVisible(REAL,REAL,Graphics*)

The GraphicsPath::IsVisible method determines whether a specified point lies in the area that is filled when this path is filled by a specified Graphics object.

GraphicsPath::Outline

The GraphicsPath::Outline method transforms and flattens this path, and then converts this path's data points so that they represent only the outline of the path.

GraphicsPath::Reset

The GraphicsPath::Reset method empties the path and sets the fill mode to FillModeAlternate.

GraphicsPath::Reverse

The GraphicsPath::Reverse method reverses the order of the points that define this path's lines and curves.

GraphicsPath::SetFillMode

The GraphicsPath::SetFillMode method sets the fill mode of this path.

GraphicsPath::SetMarker

The GraphicsPath::SetMarker method designates the last point in this path as a marker point.

GraphicsPath::StartFigure

The GraphicsPath::StartFigure method starts a new figure without closing the current figure. Subsequent points added to this path are added to the new figure.

GraphicsPath::Transform

The GraphicsPath::Transform method multiplies each of this path's data points by a specified matrix.

GraphicsPath::Warp

The GraphicsPath::Warp method applies a warp transformation to this path. The GraphicsPath::Warp method also flattens (converts to a sequence of straight lines) the path.

GraphicsPath::Widen

The GraphicsPath::Widen method replaces this path with curves that enclose the area that is filled when this path is drawn by a specified pen. The GraphicsPath::Widen method also flattens the path.

 

Remarks

A path consists of one or more figures. As you add lines and curves to a path, those lines and curves become part of a figure. You can start a new figure by calling the GraphicsPath::StartFigure method. When you draw a path, the lines and curves within an individual figure are connected by straight lines; the ending point of one line or curve is connected to the starting point of the next line or curve. No connecting line is drawn between the end of one figure and the start of the next figure.

A figure can be open or closed. You can close a figure by calling the GraphicsPath::CloseFigure method. After you call GraphicsPath::CloseFigure, the next line, curve, or shape that you add to the path is part of the next figure. When you draw a path, the ending point of each closed figure is automatically connected to the starting point of that figure.

Some shapes (for example, rectangles and ellipses) are intrinsically closed. When you add an intrinsically closed shape to a path, that shape is in a figure by itself, and that figure is considered closed even if you don't call GraphicsPath::CloseFigure. The following methods add intrinsically closed figures to a path:

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft