Class PathBuilder
Allow you to derivatively build shapes and paths.
Inherited Members
Namespace: SixLabors.ImageSharp.Drawing
Assembly: SixLabors.ImageSharp.Drawing.dll
Syntax
public class PathBuilder
Constructors
| Improve this Doc View SourcePathBuilder()
Initializes a new instance of the PathBuilder class.
Declaration
public PathBuilder()
PathBuilder(Matrix3x2)
Initializes a new instance of the PathBuilder class.
Declaration
public PathBuilder(Matrix3x2 defaultTransform)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | defaultTransform | The default transform. |
Methods
| Improve this Doc View SourceAddBezier(PointF, PointF, PointF)
Adds a quadratic bezier curve to the current figure joining the last point to the endPoint.
Declaration
public PathBuilder AddBezier(PointF startPoint, PointF controlPoint, PointF endPoint)
Parameters
Type | Name | Description |
---|---|---|
PointF | startPoint | The start point. |
PointF | controlPoint | The control point1. |
PointF | endPoint | The end point. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddBezier(PointF, PointF, PointF, PointF)
Adds a cubic bezier curve to the current figure joining the last point to the endPoint.
Declaration
public PathBuilder AddBezier(PointF startPoint, PointF controlPoint1, PointF controlPoint2, PointF endPoint)
Parameters
Type | Name | Description |
---|---|---|
PointF | startPoint | The start point. |
PointF | controlPoint1 | The control point1. |
PointF | controlPoint2 | The control point2. |
PointF | endPoint | The end point. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddLine(PointF, PointF)
Adds the line connecting the current point to the new point.
Declaration
public PathBuilder AddLine(PointF start, PointF end)
Parameters
Type | Name | Description |
---|---|---|
PointF | start | The start. |
PointF | end | The end. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddLine(Single, Single, Single, Single)
Adds the line connecting the current point to the new point.
Declaration
public PathBuilder AddLine(float x1, float y1, float x2, float y2)
Parameters
Type | Name | Description |
---|---|---|
Single | x1 | The x1. |
Single | y1 | The y1. |
Single | x2 | The x2. |
Single | y2 | The y2. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddLines(PointF[])
Adds a series of line segments connecting the current point to the new points.
Declaration
public PathBuilder AddLines(params PointF[] points)
Parameters
Type | Name | Description |
---|---|---|
PointF[] | points | The points. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddLines(IEnumerable<PointF>)
Adds a series of line segments connecting the current point to the new points.
Declaration
public PathBuilder AddLines(IEnumerable<PointF> points)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PointF> | points | The points. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
AddSegment(ILineSegment)
Adds the segment.
Declaration
public PathBuilder AddSegment(ILineSegment segment)
Parameters
Type | Name | Description |
---|---|---|
ILineSegment | segment | The segment. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
Build()
Builds a complex polygon fromn the current working set of working operations.
Declaration
public IPath Build()
Returns
Type | Description |
---|---|
IPath | The current set of operations as a complex polygon |
Clear()
Clears all drawn paths, Leaving any applied transforms.
Declaration
public void Clear()
CloseAllFigures()
Closes the current figure.
Declaration
public PathBuilder CloseAllFigures()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
CloseFigure()
Closes the current figure.
Declaration
public PathBuilder CloseFigure()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
Reset()
Resets this instance, clearing any drawn paths and reseting any transforms.
Declaration
public PathBuilder Reset()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
ResetOrigin()
Resets the origin to the default.
Declaration
public PathBuilder ResetOrigin()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
ResetTransform()
Resets the translation to the default.
Declaration
public PathBuilder ResetTransform()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
SetOrigin(PointF)
Sets the origin all subsequent point should be relative to.
Declaration
public PathBuilder SetOrigin(PointF origin)
Parameters
Type | Name | Description |
---|---|---|
PointF | origin | The origin. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
SetTransform(Matrix3x2)
Sets the translation to be applied to all items to follow being applied to the PathBuilder.
Declaration
public PathBuilder SetTransform(Matrix3x2 translation)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | translation | The translation. |
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |
StartFigure()
Starts a new figure but leaves the previous one open.
Declaration
public PathBuilder StartFigure()
Returns
Type | Description |
---|---|
PathBuilder | The PathBuilder |