PathBuilder Class
Builds a PathData.
public sealed class PathBuilderConstructors
| Name | Description |
|---|---|
| PathBuilder() |
PathBuilder()
PathBuilder.cspublic PathBuilder()No documentation is available.
Properties
| Name | Description |
|---|---|
| IsEmpty | Gets a value that indicates whether no command was added. |
IsEmpty
PathBuilder.csMethods
| Name | Description |
|---|---|
| AddCircle(double, double, double) | Adds a circle, as two half arcs, clockwise. |
| AddEllipse(double, double, double, double) | Adds an ellipse, as four cubic Bézier curves, clockwise from its rightmost point. |
| AddPolygon(ReadOnlySpan<(double X, double Y)>) | Adds a closed polygon through points, in order. Nothing is added when there are no points. |
| AddRectangle(double, double, double, double) | Adds a rectangle, clockwise. |
| AddRoundedRectangle(double, double, double, double, double) | Adds a rectangle with rounded corners, clockwise. The corners are quarters of a circle, as cubic Bézier curves. |
| Append(PathData) | Adds the commands of a path, unchanged. |
| ArcTo(double, double, double, bool, bool, double, double) | Draws an elliptical arc, as the SVG A command. |
| Build() | Creates the path. |
| Close() | Closes the current contour. |
| CubicTo(double, double, double, double, double, double) | Draws a cubic Bézier curve. |
| LineTo(double, double) | Draws a straight line. |
| MoveTo(double, double) | Starts a new contour. |
| QuadraticTo(double, double, double, double) | Draws a quadratic Bézier curve. |
AddCircle(double, double, double)
PathBuilder.csAdds a circle, as two half arcs, clockwise.
public PathBuilder AddCircle(double centerX, double centerY, double radius)Parameters
centerXdouble- The x coordinate of the center.
centerYdouble- The y coordinate of the center.
radiusdouble- The radius.
Returns
PathBuilder The builder.
AddEllipse(double, double, double, double)
PathBuilder.csAdds an ellipse, as four cubic Bézier curves, clockwise from its rightmost point.
public PathBuilder AddEllipse(double centerX, double centerY, double radiusX, double radiusY)Parameters
centerXdouble- The x coordinate of the center.
centerYdouble- The y coordinate of the center.
radiusXdouble- The x radius.
radiusYdouble- The y radius.
Returns
PathBuilder The builder.
AddPolygon(ReadOnlySpan<(double X, double Y)>)
PathBuilder.csAdds a closed polygon through points, in order. Nothing is added when there are no points.
public PathBuilder AddPolygon(params scoped ReadOnlySpan<(double X, double Y)> points)Parameters
pointsReadOnlySpan<(double X, double Y)>- The vertices of the polygon.
Returns
PathBuilder The builder.
AddRectangle(double, double, double, double)
PathBuilder.csAdds a rectangle, clockwise.
public PathBuilder AddRectangle(double x, double y, double width, double height)AddRoundedRectangle(double, double, double, double, double)
PathBuilder.csAdds a rectangle with rounded corners, clockwise. The corners are quarters of a circle, as cubic Bézier curves.
public PathBuilder AddRoundedRectangle(double x, double y, double width, double height, double radius)Parameters
xdouble- The left edge.
ydouble- The top edge.
widthdouble- The width.
heightdouble- The height.
radiusdouble- The radius of the corners, limited to half the smaller side. When it is not positive, the rectangle is the same as
PathBuilder.AddRectangle.
Returns
PathBuilder The builder.
Append(PathData)
PathBuilder.csAdds the commands of a path, unchanged.
public PathBuilder Append(PathData path)ArcTo(double, double, double, bool, bool, double, double)
PathBuilder.csDraws an elliptical arc, as the SVG A command.
public PathBuilder ArcTo(double radiusX, double radiusY, double rotation, bool largeArc, bool sweep, double x, double y)Parameters
radiusXdouble- The x radius.
radiusYdouble- The y radius.
rotationdouble- The rotation of the ellipse, in degrees.
largeArcbool- Whether the arc is the larger of the two candidate arcs.
sweepbool- Whether the arc is drawn clockwise.
xdouble- The x coordinate of the end.
ydouble- The y coordinate of the end.
Returns
PathBuilder The builder.
Build()
PathBuilder.csClose()
PathBuilder.csCubicTo(double, double, double, double, double, double)
PathBuilder.csDraws a cubic Bézier curve.
Parameters
x1double- The x coordinate of the first control point.
y1double- The y coordinate of the first control point.
x2double- The x coordinate of the second control point.
y2double- The y coordinate of the second control point.
xdouble- The x coordinate of the end.
ydouble- The y coordinate of the end.
Returns
PathBuilder The builder.
LineTo(double, double)
PathBuilder.csDraws a straight line.
public PathBuilder LineTo(double x, double y)MoveTo(double, double)
PathBuilder.csStarts a new contour.
public PathBuilder MoveTo(double x, double y)QuadraticTo(double, double, double, double)
PathBuilder.csDraws a quadratic Bézier curve.
public PathBuilder QuadraticTo(double x1, double y1, double x, double y)Parameters
x1double- The x coordinate of the control point.
y1double- The y coordinate of the control point.
xdouble- The x coordinate of the end.
ydouble- The y coordinate of the end.
Returns
PathBuilder The builder.