GraphicsPath

open class GraphicsPath

Represents a path with Graphics objects.

  • Initializes a new instance of the GraphicsPath class.

    Declaration

    Swift

    public init()

    Return Value

    The newly created GraphicsPath.

  • Adds a line to the current GraphicsPath.

    Declaration

    Swift

    open func addLine(_ p1: Point, p2: Point)

    Parameters

    p1

    A Point that specifies the start of the line.

    p2

    A Point that specifies the end of the line.

  • Adds a rectangle to the current GraphicsPath.

    Declaration

    Swift

    open func addRect(_ rect: Rect)

    Parameters

    rect

    A rectangle object that specifies the location and size of the rectangle to be drawn.

  • Adds an arc to the current GraphicsPath.

    Declaration

    Swift

    open func addArc(_ rect: Rect, startAngle: Double, sweepAngle: Double)

    Parameters

    rect

    A rectangle object that specifies the bounding rectangle for the ellipse that contains the arc to be drawn.

    startAngle

    The angle where the arc starts.

    sweepAngle

    The sweeping angle of the arc.

  • Adds a Bezier curve to the current GraphicsPath.

    Declaration

    Swift

    open func addBezier(_ points: [Point])

    Parameters

    points

    An array with Point objects that specifies the control points of the Bezier curve to be drawn.

  • Adds the current GraphicsPath to the specified canvas.

    Declaration

    Swift

    open func addToCanvas(_ canvas: Canvas)

    Parameters

    canvas

    The canvas to add the current GraphicsPath to.

  • Converts each curve in the current GraphicsPath to a sequence of line segments.

    Declaration

    Swift

    open func flatten(_ matrix: Matrix)

    Parameters

    matrix

    The matrix., by which the GraphicsPath is transformed before flattening.

  • Converts each curve in the current GraphicsPath to a sequence of line segments.

    Declaration

    Swift

    open func flatten(_ matrix: Matrix, error: Double)

    Parameters

    matrix

    The matrix., by which the GraphicsPath is transformed before flattening.

    error

    The maximum allowed error between each curve and its flattened transformation.

  • Applies the specified transform matrix to the current GraphicsPath.

    Declaration

    Swift

    open func transform(_ matrix: Matrix)

    Parameters

    matrix

    The matrix to apply.

  • Starts a figure in this GraphicsPath.

    Declaration

    Swift

    open func startFigure()