[]
A helper class for creating GraphicsPath objects.
public class PathBuilder
Initializes a new instance of the PathBuilder class.
public PathBuilder()
Gets a value indicating if the active figure contains one or more segments.
public bool FigureHasSegments { get; }
Gets the list of figures to be converted to a path.
public List<IFigure> Figures { get; }
Gets a value indicating if there is an active figure to update.
public bool FigureStarted { get; }
Adds a single arc to the path geometry.
public void AddArc(ArcSegment arcSegment)
arcSegment
ArcSegmentThe arc segment to add to the figure.
Creates a cubic Bezier curve and adds it to the figure.
public void AddCubicBezier(PointF controlPoint1, PointF controlPoint2, PointF endPoint)
controlPoint1
System.Drawing.PointFcontrolPoint2
System.Drawing.PointFendPoint
System.Drawing.PointFCreates a sequence of cubic Bezier curves and adds them to the figure.
public void AddCubicBeziers(params PointF[] points)
points
System.Drawing.PointF[]Control point 1, control point 2, and the end point for one or several cubic Bezier curves.
Adds an existing figure to the path.
public void AddFigure(IFigure figure)
figure
IFigureAdds one or several existing figures to the path.
public void AddFigures(params IFigure[] figures)
figures
IFigure[]Creates a line segment between the current point and the specified end point and adds it to the figure.
public void AddLine(PointF endPoint)
endPoint
System.Drawing.PointFThe end point of the line to draw.
Creates a line segment between the current point and the specified end point and adds it to the figure.
public void AddLine(float endPointX, float endPointY)
endPointX
floatThe x-coordinate of the end point of the line to draw.
endPointY
floatThe y-coordinate of the end point of the line to draw.
Creates a sequence of lines using the specified points and adds them to the figure.
public void AddLines(params PointF[] points)
points
System.Drawing.PointF[]An array of one or more points that describe the lines to draw.
Creates a quadratic Bezier curve and adds it to the figure.
public void AddQuadraticBezier(PointF controlPoint, PointF endPoint)
controlPoint
System.Drawing.PointFendPoint
System.Drawing.PointFCreates a sequence of quadratic Bezier curves and adds them to the figure.
public void AddQuadraticBeziers(params PointF[] points)
points
System.Drawing.PointF[]Control point and the end point for one or several quadratic Bezier curves.
Starts a new figure at the specified point.
public void BeginFigure(PointF startPoint)
startPoint
System.Drawing.PointFThe point at which to begin the new figure.
Starts a new figure at the specified point.
public void BeginFigure(float startX, float startY)
startX
floatThe x-coordinate of the point at which to begin the new figure.
startY
floatThe y-coordinate of the point at which to begin the new figure.
Discards the active figure.
public void CancelFigure()
Clears the list of figures and all pending changes.
public void Clear()
Ends the current figure; optionally, closes it.
public IFigure EndFigure(bool closeFigure)
closeFigure
boolA value indicating whether the current figure should be closed. If the figure is closed, a line is drawn between the end point of the last segment and the start point.
Creates a GraphicsPath from the current set of figures.
public GraphicsPath ToPath(FillMode fillMode, Matrix3x2 worldTransform)
fillMode
FillModeSpecifies how the interior of closed figures is filled.
worldTransform
System.Numerics.Matrix3x2The transformation to apply to path figures.
Creates a GraphicsPath from the current set of figures.
public GraphicsPath ToPath(FillMode fillMode = FillMode.Alternate)
fillMode
FillModeSpecifies how the interior of closed figures is filled.