Android Guides | Samples

Android.Graphics.Path Class

The Path class encapsulates compound (multiple contour) geometric paths consisting of straight line segments, quadratic curves, and cubic curves.

See Also: Path

Syntax

[Android.Runtime.Register("android/graphics/Path", DoNotGenerateAcw=true)]
public class Path : Object

Remarks

The Path class encapsulates compound (multiple contour) geometric paths consisting of straight line segments, quadratic curves, and cubic curves. It can be drawn with canvas.drawPath(path, paint), either filled or stroked (based on the paint's Style), or it can be used for clipping or to draw text on a path.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Graphics.Path are listed below.

See Also: Object

Public Constructors

Create an empty path
Create a new path, copying the contents from the src path.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
IsConvexBoolean. Returns the path's convexity, as defined by the content of the path.
[read-only]
IsEmptyBoolean. Returns true if the path is empty (contains no lines or curves)
[read-only]
IsInverseFillTypeBoolean. Returns true if the filltype is one of the INVERSE variants

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddArc(RectF, Single, Single)
Add the specified arc to the path as a new contour.
AddArc(Single, Single, Single, Single, Single, Single)
Add the specified arc to the path as a new contour.
AddCircle(Single, Single, Single, Path+Direction)
Add a closed circle contour to the path
AddOval(RectF, Path+Direction)
Add a closed oval contour to the path
AddOval(Single, Single, Single, Single, Path+Direction)
Add a closed oval contour to the path
AddPath(Path)
Add a copy of src to the path
AddPath(Path, Matrix)
Add a copy of src to the path, transformed by matrix
AddPath(Path, Single, Single)
Add a copy of src to the path, offset by (dx,dy)
AddRect(RectF, Path+Direction)
Add a closed rectangle contour to the path
AddRect(Single, Single, Single, Single, Path+Direction)
Add a closed rectangle contour to the path
AddRoundRect(RectF, Single[], Path+Direction)
Add a closed round-rectangle contour to the path.
AddRoundRect(RectF, Single, Single, Path+Direction)
Add a closed round-rectangle contour to the path
AddRoundRect(Single, Single, Single, Single, Single[], Path+Direction)
Add a closed round-rectangle contour to the path.
AddRoundRect(Single, Single, Single, Single, Single, Single, Path+Direction)
Add a closed round-rectangle contour to the path
ArcTo(RectF, Single, Single)
Append the specified arc to the path as a new contour.
ArcTo(RectF, Single, Single, Boolean)
Append the specified arc to the path as a new contour.
ArcTo(Single, Single, Single, Single, Single, Single, Boolean)
Append the specified arc to the path as a new contour.
Close()
Close the current contour.
ComputeBounds(RectF, Boolean)
Compute the bounds of the control points of the path, and write the answer into bounds.
CubicTo(Single, Single, Single, Single, Single, Single)
Add a cubic bezier from the last point, approaching control points (x1,y1) and (x2,y2), and ending at (x3,y3).
GetFillType() : Path+FillType
Return the path's fill type.
IncReserve(Int32)
Hint to the path to prepare for adding more points.
InvokeOp(Path, Path+Op) : Boolean
Set this path to the result of applying the Op to this path and the specified path.
InvokeOp(Path, Path, Path+Op) : Boolean
Set this path to the result of applying the Op to the two specified paths.
IsRect(RectF) : Boolean
Returns true if the path specifies a rectangle.
LineTo(Single, Single)
Add a line from the last point to the specified point (x,y).
MoveTo(Single, Single)
Set the beginning of the next contour to the point (x,y).
Offset(Single, Single)
Offset the path by (dx,dy)
Offset(Single, Single, Path)
Offset the path by (dx,dy)
QuadTo(Single, Single, Single, Single)
Add a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2).
RCubicTo(Single, Single, Single, Single, Single, Single)
Same as cubicTo, but the coordinates are considered relative to the current point on this contour.
Reset()
Clear any lines and curves from the path, making it empty.
Rewind()
Rewinds the path: clears any lines and curves from the path but keeps the internal data structure for faster reuse.
RLineTo(Single, Single)
Same as lineTo, but the coordinates are considered relative to the last point on this contour.
RMoveTo(Single, Single)
Set the beginning of the next contour relative to the last point on the previous contour.
RQuadTo(Single, Single, Single, Single)
Same as quadTo, but the coordinates are considered relative to the last point on this contour.
Set(Path)
Replace the contents of this with the contents of src.
SetFillType(Path+FillType)
Set the path's fill type.
SetLastPoint(Single, Single)
Sets the last point of the path.
ToggleInverseFillType()
Toggles the INVERSE state of the filltype
Transform(Matrix)
Transform the points in this path by matrix.
Transform(Matrix, Path)
Transform the points in this path by matrix, and write the answer into dst.