CanvasPathBuilder Class |
Namespace: Microsoft.Graphics.Canvas.Geometry
public sealed class CanvasPathBuilder : IDisposable
The CanvasPathBuilder type exposes the following members.
Name | Description | |
---|---|---|
CanvasPathBuilder | Initializes a new instance of the CanvasPathBuilder class. |
Name | Description | |
---|---|---|
AddArc(Vector2, Single, Single, Single, Single) | Adds a single arc to the path, specified as a portion of an ellipse. | |
AddArc(Vector2, Single, Single, Single, CanvasSweepDirection, CanvasArcSize) | Adds a single arc to the path, specified by start and end points through which an ellipse will be fitted. | |
AddCubicBezier | Adds a cubic bezier to the path. The bezier starts where the path left off, and has the specified control points and end point. | |
AddGeometry | Adds all the figures of the specified geometry to the path. | |
AddLine(Vector2) | Adds a line segment to the path, with the specified end point. | |
AddLine(Single, Single) | Adds a line segment to the path, with the specified end point. | |
AddQuadraticBezier | Adds a quadratic bezier to the path. The bezier starts where the path left off, and has the specified control point and end point. | |
BeginFigure(Vector2) | Starts a new figure at the specified point, with the default figure fill option of Default. | |
BeginFigure(Single, Single) | Starts a new figure at the specified point, with the default figure fill option of Default. | |
BeginFigure(Vector2, CanvasFigureFill) | Starts a new figure at the specified point, with the specified figure fill option. | |
BeginFigure(Single, Single, CanvasFigureFill) | Starts a new figure at the specified point, with the specified figure fill option. | |
Dispose | Releases all resources used by the CanvasPathBuilder. | |
EndFigure | Ends the current figure; optionally, closes it. | |
SetFilledRegionDetermination | Specifies the method used to determine which points are inside the geometry described by this path builder, and which points are outside. | |
SetSegmentOptions | Specifies stroke and join options to be applied to new segments added to the path builder. |
The following is an example of how to create a simple CanvasGeometry using a CanvasPathBuilder object.
CanvasPathBuilder pathBuilder = new CanvasPathBuilder(device); pathBuilder.BeginFigure(1, 1); pathBuilder.AddLine(300, 300); pathBuilder.AddLine(1, 300); pathBuilder.EndFigure(CanvasFigureLoop.Closed); CanvasGeometry triangleGeometry = CanvasGeometry.CreatePath(pathBuilder);