• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.ImageSharp.Drawing
      • ArcLineSegment
      • ClipPathExtensions
      • ClippingOperation
      • ComplexPolygon
      • CubicBezierLineSegment
      • EllipsePolygon
      • EmptyPath
      • EndCapStyle
      • ILineSegment
      • IPath
      • IPathCollection
      • ISimplePath
      • IntersectionRule
      • JointStyle
      • LinearLineSegment
      • OutlinePathExtensions
      • Path
      • PathBuilder
      • PathCollection
      • PathExtensions
      • PathTypes
      • Polygon
      • RectangularPolygon
      • RegularPolygon
      • SegmentInfo
      • Star
      • TextBuilder
    • SixLabors.ImageSharp.Drawing.Processing
      • Brush
      • BrushApplicator<TPixel>
      • Brushes
      • ClearExtensions
      • ClearPathExtensions
      • ClearRectangleExtensions
      • ClipPathExtensions
      • ColorStop
      • DrawBezierExtensions
      • DrawLineExtensions
      • DrawPathCollectionExtensions
      • DrawPathExtensions
      • DrawPolygonExtensions
      • DrawRectangleExtensions
      • DrawTextExtensions
      • DrawingOptions
      • DrawingOptionsDefaultsExtensions
      • EllipticGradientBrush
      • FillExtensions
      • FillPathBuilderExtensions
      • FillPathCollectionExtensions
      • FillPathExtensions
      • FillPolygonExtensions
      • FillRectangleExtensions
      • GradientBrush
      • GradientRepetitionMode
      • ImageBrush
      • LinearGradientBrush
      • PathGradientBrush
      • PatternBrush
      • PatternPen
      • Pen
      • PenOptions
      • Pens
      • RadialGradientBrush
      • RecolorBrush
      • RichTextOptions
      • RichTextRun
      • ShapeGraphicOptionsDefaultsExtensions
      • ShapeOptions
      • SolidBrush
      • SolidPen
    • SixLabors.ImageSharp.Drawing.Processing.Processors.Drawing
      • ClipPathProcessor
      • DrawPathProcessor
      • FillPathProcessor
      • FillProcessor
    • SixLabors.ImageSharp.Drawing.Processing.Processors.Text
      • DrawTextProcessor
    • SixLabors.ImageSharp.Drawing.Shapes.PolygonClipper
      • ClipperException
      • ClippingType

    Class PathBuilder

    Allow you to derivatively build shapes and paths.

    Inheritance
    object
    PathBuilder
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SixLabors.ImageSharp.Drawing
    Assembly: SixLabors.ImageSharp.Drawing.dll
    Syntax
    public class PathBuilder

    Constructors

    | Edit this page View Source

    PathBuilder()

    Initializes a new instance of the PathBuilder class.

    Declaration
    public PathBuilder()
    | Edit this page View Source

    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

    | Edit this page View Source

    AddArc(Point, int, int, int, int, int)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(Point center, int radiusX, int radiusY, int rotation, int startAngle, int sweepAngle)
    Parameters
    Type Name Description
    Point center

    The center Point of the ellipse from which the arc is taken.

    int radiusX

    The x-radius of the ellipsis.

    int radiusY

    The y-radius of the ellipsis.

    int rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    int startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    int sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(PointF, float, float, float, bool, bool, PointF)

    Adds an elliptical arc to the current figure. The arc curves from the startPoint to endPoint, choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger.

    The arc sweep is always less than 360 degrees. The method appends a line to the last point if either radii are zero, or if last point is equal to endPoint. In addition the method scales the radii to fit last point and endPoint if both are greater than zero but too small to describe an arc.

    Declaration
    public PathBuilder AddArc(PointF startPoint, float radiusX, float radiusY, float rotation, bool largeArc, bool sweep, PointF endPoint)
    Parameters
    Type Name Description
    PointF startPoint

    The start point of the arc.

    float radiusX

    The x-radius of the ellipsis.

    float radiusY

    The y-radius of the ellipsis.

    float rotation

    The rotation along the X-axis; measured in degrees clockwise.

    bool largeArc

    The large arc flag, and is false if an arc spanning less than or equal to 180 degrees is chosen, or true if an arc spanning greater than 180 degrees is chosen.

    bool sweep

    The sweep flag, and is false if the line joining center to arc sweeps through decreasing angles, or true if it sweeps through increasing angles.

    PointF endPoint

    The end point of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(PointF, float, float, float, float, float)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(PointF center, float radiusX, float radiusY, float rotation, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PointF center

    The center PointF of the ellipse from which the arc is taken.

    float radiusX

    The x-radius of the ellipsis.

    float radiusY

    The y-radius of the ellipsis.

    float rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    float startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    float sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(Rectangle, int, int, int)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(Rectangle rectangle, int rotation, int startAngle, int sweepAngle)
    Parameters
    Type Name Description
    Rectangle rectangle

    A Rectangle that represents the rectangular bounds of the ellipse from which the arc is taken.

    int rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    int startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    int sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(RectangleF, float, float, float)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(RectangleF rectangle, float rotation, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    RectangleF rectangle

    A RectangleF that represents the rectangular bounds of the ellipse from which the arc is taken.

    float rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    float startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    float sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(int, int, int, int, int, int, int)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(int x, int y, int radiusX, int radiusY, int rotation, int startAngle, int sweepAngle)
    Parameters
    Type Name Description
    int x

    The x-coordinate of the center point of the ellipse from which the arc is taken.

    int y

    The y-coordinate of the center point of the ellipse from which the arc is taken.

    int radiusX

    The x-radius of the ellipsis.

    int radiusY

    The y-radius of the ellipsis.

    int rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    int startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    int sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddArc(float, float, float, float, float, float, float)

    Adds an elliptical arc to the current figure.

    Declaration
    public PathBuilder AddArc(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    float x

    The x-coordinate of the center point of the ellipse from which the arc is taken.

    float y

    The y-coordinate of the center point of the ellipse from which the arc is taken.

    float radiusX

    The x-radius of the ellipsis.

    float radiusY

    The y-radius of the ellipsis.

    float rotation

    The angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.

    float startAngle

    The start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).

    float sweepAngle

    The angle between startAngle and the end of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddCubicBezier(PointF, PointF, PointF, PointF)

    Adds a cubic bezier curve to the current figure joining the startPoint point to the endPoint.

    Declaration
    public PathBuilder AddCubicBezier(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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    AddLine(float, float, float, float)

    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
    float x1

    The x1.

    float y1

    The y1.

    float x2

    The x2.

    float y2

    The y2.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    AddLines(params 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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    AddQuadraticBezier(PointF, PointF, PointF)

    Adds a quadratic bezier curve to the current figure joining the startPoint point to the endPoint.

    Declaration
    public PathBuilder AddQuadraticBezier(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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    ArcTo(float, float, float, bool, bool, PointF)

    Adds an elliptical arc to the current figure. The arc curves from the last point to point, choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger.

    The arc sweep is always less than 360 degrees. The method appends a line to the last point if either radii are zero, or if last point is equal to point. In addition the method scales the radii to fit last point and point if both are greater than zero but too small to describe an arc.

    Declaration
    public PathBuilder ArcTo(float radiusX, float radiusY, float rotation, bool largeArc, bool sweep, PointF point)
    Parameters
    Type Name Description
    float radiusX

    The x-radius of the ellipsis.

    float radiusY

    The y-radius of the ellipsis.

    float rotation

    The rotation along the X-axis; measured in degrees clockwise.

    bool largeArc

    The large arc flag, and is false if an arc spanning less than or equal to 180 degrees is chosen, or true if an arc spanning greater than 180 degrees is chosen.

    bool sweep

    The sweep flag, and is false if the line joining center to arc sweeps through decreasing angles, or true if it sweeps through increasing angles.

    PointF point

    The end point of the arc.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    Build()

    Builds a complex polygon from the current working set of working operations.

    Declaration
    public IPath Build()
    Returns
    Type Description
    IPath

    The current set of operations as a complex polygon

    | Edit this page View Source

    Clear()

    Clears all drawn paths, Leaving any applied transforms.

    Declaration
    public void Clear()
    | Edit this page View Source

    CloseAllFigures()

    Closes the current figure.

    Declaration
    public PathBuilder CloseAllFigures()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    CloseFigure()

    Closes the current figure.

    Declaration
    public PathBuilder CloseFigure()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    CubicBezierTo(Vector2, Vector2, Vector2)

    Draws a quadratic bezier from the current point to the point

    Declaration
    public PathBuilder CubicBezierTo(Vector2 secondControlPoint, Vector2 thirdControlPoint, Vector2 point)
    Parameters
    Type Name Description
    Vector2 secondControlPoint

    The second control point.

    Vector2 thirdControlPoint

    The third control point.

    Vector2 point

    The point.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    LineTo(PointF)

    Draws the line connecting the current the current point to the new point.

    Declaration
    public PathBuilder LineTo(PointF point)
    Parameters
    Type Name Description
    PointF point

    The point.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    LineTo(float, float)

    Draws the line connecting the current the current point to the new point.

    Declaration
    public PathBuilder LineTo(float x, float y)
    Parameters
    Type Name Description
    float x

    The x.

    float y

    The y.

    Returns
    Type Description
    PathBuilder

    The PathBuilder

    | Edit this page View Source

    MoveTo(PointF)

    Moves to current point to the supplied vector.

    Declaration
    public PathBuilder MoveTo(PointF point)
    Parameters
    Type Name Description
    PointF point

    The point.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    QuadraticBezierTo(Vector2, Vector2)

    Draws a quadratic bezier from the current point to the point

    Declaration
    public PathBuilder QuadraticBezierTo(Vector2 secondControlPoint, Vector2 point)
    Parameters
    Type Name Description
    Vector2 secondControlPoint

    The second control point.

    Vector2 point

    The point.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    Reset()

    Resets this instance, clearing any drawn paths and resetting any transforms.

    Declaration
    public PathBuilder Reset()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    ResetOrigin()

    Resets the origin to the default.

    Declaration
    public PathBuilder ResetOrigin()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    ResetTransform()

    Resets the transform to the default.

    Declaration
    public PathBuilder ResetTransform()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    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.

    | Edit this page View Source

    SetTransform(Matrix3x2)

    Sets the translation to be applied to all items to follow being applied to the PathBuilder.

    Declaration
    public PathBuilder SetTransform(Matrix3x2 transform)
    Parameters
    Type Name Description
    Matrix3x2 transform

    The transform.

    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    | Edit this page View Source

    StartFigure()

    Starts a new figure but leaves the previous one open.

    Declaration
    public PathBuilder StartFigure()
    Returns
    Type Description
    PathBuilder

    The PathBuilder.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX