RecordingCanvas Class

Definition

A Canvas implementation that records view system drawing operations for deferred rendering.

[Android.Runtime.Register("android/graphics/RecordingCanvas", ApiSince=29, DoNotGenerateAcw=true)]
public sealed class RecordingCanvas : Android.Graphics.Canvas
[<Android.Runtime.Register("android/graphics/RecordingCanvas", ApiSince=29, DoNotGenerateAcw=true)>]
type RecordingCanvas = class
    inherit Canvas
Inheritance
RecordingCanvas
Attributes

Remarks

A Canvas implementation that records view system drawing operations for deferred rendering. This is used in combination with RenderNode. This class keeps a list of all the Paint and Bitmap objects that it draws, preventing the backing memory of Bitmaps from being released while the RecordingCanvas is still holding a native reference to the memory.

This is obtained by calling RenderNode#beginRecording() and is valid until the matching RenderNode#endRecording() is called. It must not be retained beyond that as it is internally reused.

Java documentation for android.graphics.RecordingCanvas.

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.

Properties

Name Description
Class

Returns the runtime class of this Object.

(Inherited from Object)
ClipBounds

Retrieve the bounds of the current clip (in local coordinates).

(Inherited from Canvas)
Density

Returns the target density of the canvas. -or- Specifies the density for this Canvas' backing bitmap.

(Inherited from Canvas)
DrawFilter (Inherited from Canvas)
GL (Inherited from Canvas)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Height

Returns the height of the current drawing layer

(Inherited from Canvas)
IsHardwareAccelerated

Indicates whether this Canvas uses hardware acceleration.

(Inherited from Canvas)
IsOpaque

Return true if the device that the current layer draws into is opaque (that is, it does not support per-pixel alpha).

(Inherited from Canvas)
JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers
Matrix
Obsolete.

Return a new matrix with a copy of the canvas' current transformation matrix. -or- Completely replace the current matrix with the specified matrix.

(Inherited from Canvas)
MaximumBitmapHeight

Returns the maximum allowed height for bitmaps drawn with this canvas.

(Inherited from Canvas)
MaximumBitmapWidth

Returns the maximum allowed width for bitmaps drawn with this canvas.

(Inherited from Canvas)
PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
SaveCount

Returns the number of matrix/clip states on the Canvas' private stack.

(Inherited from Canvas)
ThresholdClass

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

(Inherited from Canvas)
ThresholdType

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

(Inherited from Canvas)
Width

Returns the width of the current drawing layer

(Inherited from Canvas)

Methods

Name Description
ClipOutPath(Path)

Set the clip to the difference of the current clip and the specified path.

(Inherited from Canvas)
ClipOutRect(Int32, Int32, Int32, Int32)

Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipOutRect(Rect)

Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipOutRect(RectF)

Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipOutRect(Single, Single, Single, Single)

Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipOutShader(Shader)

Set the clip to the difference of the current clip and the shader.

(Inherited from Canvas)
ClipPath(Path, Region+Op)

Intersect the current clip with the specified path.

(Inherited from Canvas)
ClipPath(Path)

Intersect the current clip with the specified path.

(Inherited from Canvas)
ClipRect(Int32, Int32, Int32, Int32)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(Rect, Region+Op)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(Rect)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(RectF, Region+Op)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(RectF)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(Single, Single, Single, Single, Region+Op)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRect(Single, Single, Single, Single)

Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

(Inherited from Canvas)
ClipRegion(Region, Region+Op)
Obsolete.

Modify the current clip with the specified region.

(Inherited from Canvas)
ClipRegion(Region)
Obsolete.

Intersect the current clip with the specified region.

(Inherited from Canvas)
ClipShader(Shader)

Intersect the current clip with the specified shader.

(Inherited from Canvas)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Concat(Matrix)

Preconcat the current matrix with the specified matrix.

(Inherited from Canvas)
Concat(Matrix44)

Preconcat the current matrix with the specified matrix.

(Inherited from Canvas)
Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
DisableZ()

Disables Z support, preventing any RenderNodes drawn after this point from being visually reordered or having shadows rendered.

(Inherited from Canvas)
Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
DrawArc(RectF, Single, Single, Boolean, Paint)

Draw the specified arc, which will be scaled to fit inside the specified oval.

DrawArc(Single, Single, Single, Single, Single, Single, Boolean, Paint)

Draw the specified arc, which will be scaled to fit inside the specified oval.

DrawARGB(Int32, Int32, Int32, Int32)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified ARGB color, using srcover porterduff mode.

DrawBitmap(Bitmap, Matrix, Paint)

Draw the bitmap using the specified matrix.

DrawBitmap(Bitmap, Rect, Rect, Paint)

Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle.

DrawBitmap(Bitmap, Rect, RectF, Paint)

Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle.

DrawBitmap(Bitmap, Single, Single, Paint)

Draw the specified bitmap, with its top/left corner at (x,y), using the specified paint, transformed by the current matrix.

DrawBitmap(Int32[], Int32, Int32, Int32, Int32, Int32, Int32, Boolean, Paint)
DrawBitmap(Int32[], Int32, Int32, Single, Single, Int32, Int32, Boolean, Paint)
Obsolete.

Treat the specified array of colors as a bitmap, and draw it.

DrawBitmapMesh(Bitmap, Int32, Int32, Single[], Int32, Int32[], Int32, Paint)

Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap.

DrawCircle(Single, Single, Single, Paint)

Draw the specified circle using the specified paint.

DrawColor(Color, BlendMode)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode.

DrawColor(Color, PorterDuff+Mode)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and porter-duff xfermode.

DrawColor(Color)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode.

DrawColor(Int64, BlendMode)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode.

DrawColor(Int64)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode.

(Inherited from Canvas)
DrawDoubleRoundRect(RectF, Single, Single, RectF, Single, Single, Paint)

Draws a double rounded rectangle using the specified paint.

DrawDoubleRoundRect(RectF, Single[], RectF, Single[], Paint)

Draws a double rounded rectangle using the specified paint.

DrawGlyphs(Int32[], Int32, Single[], Int32, Int32, Font, Paint)

Draw array of glyphs with specified font.

(Inherited from Canvas)
DrawLine(Single, Single, Single, Single, Paint)

Draw a line segment with the specified start and stop x,y coordinates, using the specified paint.

DrawLines(Single[], Int32, Int32, Paint)

Draw a series of lines.

DrawLines(Single[], Paint)
DrawMesh(Mesh, BlendMode, Paint)

Draws a mesh object to the screen.

DrawOval(RectF, Paint)

Draw the specified oval using the specified paint.

DrawOval(Single, Single, Single, Single, Paint)

Draw the specified oval using the specified paint.

DrawPaint(Paint)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified paint.

DrawPatch(NinePatch, Rect, Paint)

Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore Paint.ANTI_ALIAS_FLAG is ignored.

DrawPatch(NinePatch, RectF, Paint)

Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore Paint.ANTI_ALIAS_FLAG is ignored.

DrawPath(Path, Paint)

Draw the specified path using the specified paint.

DrawPicture(Picture, Rect)

Draw the picture, stretched to fit into the dst rectangle.

DrawPicture(Picture, RectF)

Draw the picture, stretched to fit into the dst rectangle.

DrawPicture(Picture)

Save the canvas state, draw the picture, and restore the canvas state.

DrawPoint(Single, Single, Paint)

Helper for drawPoints() for drawing a single point.

DrawPoints(Single[], Int32, Int32, Paint)

Draw a series of points.

DrawPoints(Single[], Paint)

Helper for drawPoints() that assumes you want to draw the entire array

DrawPosText(Char[], Int32, Int32, Single[], Paint)
DrawPosText(String, Single[], Paint)
DrawRect(Rect, Paint)

Draw the specified Rect using the specified Paint.

DrawRect(RectF, Paint)

Draw the specified Rect using the specified paint.

DrawRect(Single, Single, Single, Single, Paint)

Draw the specified Rect using the specified paint.

DrawRegion(Region, Paint)

Draws the given region using the given paint.

DrawRenderNode(RenderNode)

Draws the given RenderNode.

(Inherited from Canvas)
DrawRGB(Int32, Int32, Int32)

Fill the entire canvas' bitmap (restricted to the current clip) with the specified RGB color, using srcover porterduff mode.

DrawRoundRect(RectF, Single, Single, Paint)

Draw the specified round-rect using the specified paint.

DrawRoundRect(Single, Single, Single, Single, Single, Single, Paint)

Draw the specified round-rect using the specified paint.

DrawText(Char[], Int32, Int32, Single, Single, Paint)

Draw the text, with origin at (x,y), using the specified paint.

DrawText(ICharSequence, Int32, Int32, Single, Single, Paint)

Draw the specified range of text, specified by start/end, with its origin at (x,y), in the specified Paint.

DrawText(String, Int32, Int32, Single, Single, Paint)

Draw the text, with origin at (x,y), using the specified paint.

DrawText(String, Single, Single, Paint)

Draw the text, with origin at (x,y), using the specified paint.

DrawTextOnPath(Char[], Int32, Int32, Path, Single, Single, Paint)

Draw the text, with origin at (x,y), using the specified paint, along the specified path.

DrawTextOnPath(String, Path, Single, Single, Paint)

Draw the text, with origin at (x,y), using the specified paint, along the specified path.

DrawTextRun(Char[], Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)

Draw a run of text, all in a single direction, with optional context for complex text shaping.

DrawTextRun(ICharSequence, Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)

Draw a run of text, all in a single direction, with optional context for complex text shaping.

DrawTextRun(MeasuredText, Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)

Draw a run of text, all in a single direction, with optional context for complex text shaping.

(Inherited from Canvas)
DrawTextRun(String, Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)

Draw a run of text, all in a single direction, with optional context for complex text shaping.

(Inherited from Canvas)
DrawVertices(Canvas+VertexMode, Int32, Single[], Int32, Single[], Int32, Int32[], Int32, Int16[], Int32, Int32, Paint)

Draw the array of vertices, interpreted as triangles (based on mode).

EnableZ()

Enables Z support which defaults to disabled.

(Inherited from Canvas)
Equals(Object) (Inherited from JavaObject)
Equals(Object)

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

(Inherited from Object)
GetClipBounds(Rect)

Return the bounds of the current clip (in local coordinates) in the bounds parameter, and return true if it is non-empty.

(Inherited from Canvas)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetMatrix(Matrix)
Obsolete.

Return, in ctm, the current transformation matrix.

(Inherited from Canvas)
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)
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)
QuickReject(Path, Canvas+EdgeType)

Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
QuickReject(Path)

Return true if the specified path, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
QuickReject(RectF, Canvas+EdgeType)

Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
QuickReject(RectF)

Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
QuickReject(Single, Single, Single, Single, Canvas+EdgeType)

Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
QuickReject(Single, Single, Single, Single)

Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip.

(Inherited from Canvas)
Restore()

This call balances a previous call to save(), and is used to remove all modifications to the matrix/clip state since the last save call.

(Inherited from Canvas)
RestoreToCount(Int32)

Efficient way to pop any calls to save() that happened after the save count reached saveCount.

(Inherited from Canvas)
Rotate(Single, Single, Single)

Preconcat the current matrix with the specified rotation.

(Inherited from Canvas)
Rotate(Single)

Preconcat the current matrix with the specified rotation.

(Inherited from Canvas)
Save()

Saves the current matrix and clip onto a private stack.

(Inherited from Canvas)
Save(SaveFlags)

Based on saveFlags, can save the current matrix and clip onto a private stack.

(Inherited from Canvas)
SaveLayer(RectF, Paint, SaveFlags)

This behaves the same as save(), but in addition it allocates and redirects drawing to an offscreen bitmap.

(Inherited from Canvas)
SaveLayer(RectF, Paint)

This behaves the same as save(), but in addition it allocates and redirects drawing to an offscreen rendering target.

(Inherited from Canvas)
SaveLayer(Single, Single, Single, Single, Paint, SaveFlags)

Helper version of saveLayer() that takes 4 values rather than a RectF.

(Inherited from Canvas)
SaveLayer(Single, Single, Single, Single, Paint)

Convenience for #saveLayer(RectF, Paint) that takes the four float coordinates of the bounds rectangle.

(Inherited from Canvas)
SaveLayerAlpha(RectF, Int32, SaveFlags)

This behaves the same as save(), but in addition it allocates and redirects drawing to an offscreen bitmap.

(Inherited from Canvas)
SaveLayerAlpha(RectF, Int32)

Convenience for #saveLayer(RectF, Paint) but instead of taking a entire Paint object it takes only the alpha parameter.

(Inherited from Canvas)
SaveLayerAlpha(Single, Single, Single, Single, Int32, SaveFlags)

Helper for saveLayerAlpha() that takes 4 values instead of a RectF.

(Inherited from Canvas)
SaveLayerAlpha(Single, Single, Single, Single, Int32)

Convenience for #saveLayerAlpha(RectF, int) that takes the four float coordinates of the bounds rectangle.

(Inherited from Canvas)
Scale(Single, Single, Single, Single)

Preconcat the current matrix with the specified scale.

(Inherited from Canvas)
Scale(Single, Single)

Preconcat the current matrix with the specified scale.

(Inherited from Canvas)
SetBitmap(Bitmap)

Specify a bitmap for the canvas to draw into.

(Inherited from Canvas)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
SetViewport(Int32, Int32) (Inherited from Canvas)
Skew(Single, Single)

Preconcat the current matrix with the specified skew.

(Inherited from Canvas)
ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
Translate(Single, Single)

Preconcat the current matrix with the specified translation

(Inherited from Canvas)
UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(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

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to