Class

iOSPath


Warning

This item was deprecated in version 2020r2. Please use GraphicsPath as a replacement.

Description

A graphics path is a mathematical description of a series of shapes or lines.

Properties

Name

Type

Read-Only

Shared

CurrentPoint

Point

IsEmpty

Boolean

IsRectangle

Boolean

Methods

Name

Parameters

Returns

Shared

AddArc

x As Double, y As Double, radius As Double, startAngle As Double, endAngle As Double, clockwise As Boolean

AddCurveToPoint

cp1x As Double, cp1y As Double, cp2X As Double, cp2Y As Double, x As Double, y As Double

AddQuadraticCurveToPoint

cpX As Double, cpY As Double, x As Double, y As Double

AddRect

x As Double, y As Double, width As Double, height As Double

AddRoundRect

x As Double, y As Double, width As Double, height As Double, cornerWidth As Double, cornerHeight As Double

LineToPoint

x As Double, y As Double

MoveToPoint

x As Double, y As Double

Property descriptions


iOSPath.CurrentPoint

CurrentPoint As Point

The current point.

This property is read-only.


iOSPath.IsEmpty

IsEmpty As Boolean

Checks if the path is empty. An empty path contains no elements.

This property is read-only.


iOSPath.IsRectangle

IsRectangle As Boolean

Checks if the path is a rectangle.

This property is read-only.

Method descriptions


iOSPath.AddArc

AddArc(x As Double, y As Double, radius As Double, startAngle As Double, endAngle As Double, clockwise As Boolean)

Adds an arc to the path.

The ending point of the Arc becomes the start point for the next element added to the path. In particular, if you add two arcs in a row, there will be a line that connects the ending point of the first arc to the starting point of the second arc. If you do not want this behavior, set the new starting point manually using MoveToPoint.

Draw an arc that is 1/4 of a circle:

Const Pi = 3.14159
Var arc As New iOSPath
arc.AddArc(50, 50, 20, 0, Pi / 2, False)
g.DrawPath(arc)

iOSPath.AddCurveToPoint

AddCurveToPoint(cp1x As Double, cp1y As Double, cp2X As Double, cp2Y As Double, x As Double, y As Double)

Adds a cubic Bézier curve to the point in the path.

Draw a cloud:

Var curve As New iOSPath
curve.MoveToPoint(20, 20)
curve.AddCurveToPoint(20, 100, 200, 100, 200, 20)
g.DrawPath(curve)

' Draw a fluffy white cloud
Var cloud As New iOSPath
cloud.MoveToPoint(170, 80)
cloud.AddCurveToPoint(130, 100, 130, 150, 230, 150)
cloud.AddCurveToPoint(250, 180, 320, 180, 340, 150)
cloud.AddCurveToPoint(420, 150, 420, 120, 390, 100)
cloud.AddCurveToPoint(430, 40, 370, 30, 340, 50)
cloud.AddCurveToPoint(320, 5, 250, 20, 250, 50)
cloud.AddCurveToPoint(200, 5, 150, 20, 170, 80)

g.LineColor = Color.Blue
g.LineWidth = 5
g.DrawPath(cloud)

iOSPath.AddQuadraticCurveToPoint

AddQuadraticCurveToPoint(cpX As Double, cpY As Double, x As Double, y As Double)

Adds a quadratic Bézier curve to the point in the path.

Draw a curve:

Var qCurve As New iOSPath
qCurve.MoveToPoint(38, 150)
qCurve.AddQuadraticCurveToPoint(138, 0, 238, 150)

g.LineWidth = 10
g.DrawPath(qCurve)

iOSPath.AddRect

AddRect(x As Double, y As Double, width As Double, height As Double)

Adds a rectangle to the path.

A simple rectangle:

Var rect As New iOSPath
rect.AddRect(10, 10, 100, 150)
g.DrawPath(rect)

iOSPath.AddRoundRect

AddRoundRect(x As Double, y As Double, width As Double, height As Double, cornerWidth As Double, cornerHeight As Double)

Adds a rounded rectangle to the path.

A simple rounded rectangle:

Var rect As New iOSPath
rect.AddRoundRect(10, 10, 100, 150, 10, 10)
g.DrawPath(rect)

iOSPath.LineToPoint

LineToPoint(x As Double, y As Double)

Draws a line from the CurrentPoint to the specified point.

Draw a triangle:

Var p As New iOSPath
p.MoveToPoint(0, 0) ' Start location
p.LineToPoint(20, 44)
p.LineToPoint(40, 0)
p.LineToPoint(0, 0)

g.LineColor = Color.Blue
g.DrawPath(p)

iOSPath.MoveToPoint

MoveToPoint(x As Double, y As Double)

Moves to the point without drawing anything.

Var p As New iOSPath
p.MoveToPoint(50, 50)

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; iOSGraphics class; UIBezierPath