Udostępnij za pośrednictwem


Path Class

Definition

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

[Android.Runtime.Register("android/graphics/Path", DoNotGenerateAcw=true)]
public class Path : Java.Lang.Object
[<Android.Runtime.Register("android/graphics/Path", DoNotGenerateAcw=true)>]
type Path = class
    inherit Object
Inheritance
Path
Attributes

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.

Java documentation for android.graphics.Path.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Path()

Create an empty path

Path(IntPtr, JniHandleOwnership)

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

Path(Path)

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

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
GenerationId

Returns the generation ID of this path.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsConvex

Returns the path's convexity, as defined by the content of the path.

IsEmpty

Returns true if the path is empty (contains no lines or curves)

IsInverseFillType

Returns true if the filltype is one of the INVERSE variants

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PathIterator

Returns an iterator over the segments of this path.

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

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, 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)

AddPath(Path)

Add a copy of src to the path

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, Single, Path+Direction)

Add a closed round-rectangle contour to the path

AddRoundRect(RectF, 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

AddRoundRect(Single, Single, Single, Single, Single[], Path+Direction)

Add a closed round-rectangle contour to the path

Approximate(Single)

Approximate the Path with a series of line segments.

ArcTo(RectF, Single, Single, Boolean)

Append the specified arc to the path as a new contour.

ArcTo(RectF, Single, Single)

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.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Close the current contour.

ComputeBounds(RectF, Boolean)

Compute the bounds of the control points of the path, and write the answer into bounds.

ConicTo(Single, Single, Single, Single, Single)

Add a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2), weighted by weight.

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).

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetFillType()

Return the path's fill type.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
IncReserve(Int32)

Hint to the path to prepare for adding more points.

Interpolate(Path, Single, Path)

This method will linearly interpolate from this path to otherPath given the interpolation parameter t, returning the result in interpolatedPath.

InvokeOp(Path, Path, Path+Op)

Set this path to the result of applying the Op to this path and the specified path.

InvokeOp(Path, Path+Op)

Set this path to the result of applying the Op to this path and the specified path.

IsInterpolatable(Path)

Two paths can be interpolated, by calling #interpolate(Path, float, Path), if they have exactly the same structure.

IsRect(RectF)

Returns true if the path specifies a rectangle.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
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).

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Offset(Single, Single, Path)

Offset the path by (dx,dy)

Offset(Single, Single)

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).

RConicTo(Single, Single, Single, Single, Single)

Same as conicTo, but the coordinates are considered relative to the last point on this contour.

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.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLastPoint(Single, Single)

Sets the last point of the path.

ToArray<T>() (Inherited from Object)
ToggleInverseFillType()

Toggles the INVERSE state of the filltype

ToString()

Returns a string representation of the object.

(Inherited from Object)
Transform(Matrix, Path)

Transform the points in this path by matrix, and write the answer into dst.

Transform(Matrix)

Transform the points in this path by matrix.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to