PathBuilder Class

Builds a PathData.

public sealed class PathBuilder

Constructors

NameDescription
PathBuilder()

PathBuilder()

PathBuilder.cs
public PathBuilder()

No documentation is available.

Properties

NameDescription
IsEmptyGets a value that indicates whether no command was added.

Gets a value that indicates whether no command was added.

public bool IsEmpty { get; }

Property value

bool

Methods

NameDescription
AddCircle(double, double, double)Adds a circle, as two half arcs, clockwise.
AddRectangle(double, double, double, double)Adds a rectangle, clockwise.
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.cs

Adds a circle, as two half arcs, clockwise.

public PathBuilder AddCircle(double centerX, double centerY, double radius)

Parameters

centerX double
The x coordinate of the center.
centerY double
The y coordinate of the center.
radius double
The radius.

Returns

PathBuilder The builder.

AddRectangle(double, double, double, double)

PathBuilder.cs

Adds a rectangle, clockwise.

public PathBuilder AddRectangle(double x, double y, double width, double height)

Parameters

x double
The left edge.
y double
The top edge.
width double
The width.
height double
The height.

Returns

PathBuilder The builder.

ArcTo(double, double, double, bool, bool, double, double)

PathBuilder.cs

Draws 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

radiusX double
The x radius.
radiusY double
The y radius.
rotation double
The rotation of the ellipse, in degrees.
largeArc bool
Whether the arc is the larger of the two candidate arcs.
sweep bool
Whether the arc is drawn clockwise.
x double
The x coordinate of the end.
y double
The y coordinate of the end.

Returns

PathBuilder The builder.

Creates the path.

public PathData Build()

Returns

PathData The path.

Closes the current contour.

public PathBuilder Close()

Returns

PathBuilder The builder.

CubicTo(double, double, double, double, double, double)

PathBuilder.cs

Draws a cubic Bézier curve.

public PathBuilder CubicTo(double x1, double y1, double x2, double y2, double x, double y)

Parameters

x1 double
The x coordinate of the first control point.
y1 double
The y coordinate of the first control point.
x2 double
The x coordinate of the second control point.
y2 double
The y coordinate of the second control point.
x double
The x coordinate of the end.
y double
The y coordinate of the end.

Returns

PathBuilder The builder.

LineTo(double, double)

PathBuilder.cs

Draws a straight line.

public PathBuilder LineTo(double x, double y)

Parameters

x double
The x coordinate of the end.
y double
The y coordinate of the end.

Returns

PathBuilder The builder.

MoveTo(double, double)

PathBuilder.cs

Starts a new contour.

public PathBuilder MoveTo(double x, double y)

Parameters

x double
The x coordinate of the start.
y double
The y coordinate of the start.

Returns

PathBuilder The builder.

QuadraticTo(double, double, double, double)

PathBuilder.cs

Draws a quadratic Bézier curve.

public PathBuilder QuadraticTo(double x1, double y1, double x, double y)

Parameters

x1 double
The x coordinate of the control point.
y1 double
The y coordinate of the control point.
x double
The x coordinate of the end.
y double
The y coordinate of the end.

Returns

PathBuilder The builder.