Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/graphics/RecordingCanvas#inhconstants) \| [Methods](https://developer.android.com/reference/android/graphics/RecordingCanvas#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/RecordingCanvas#inhmethods)

# RecordingCanvas

*** ** * ** ***


`
public

final

class
RecordingCanvas
`


`


`

`

extends https://developer.android.com/reference/android/graphics/Canvas


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.Canvas](https://developer.android.com/reference/android/graphics/Canvas) ||
|   | ↳ | android.graphics.RecordingCanvas |

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/android/graphics/RenderNode#beginRecording()` and is valid until the matching
`https://developer.android.com/reference/android/graphics/RenderNode#endRecording()` is called. It must not be retained beyond that as it is
internally reused.

## Summary

| ### Inherited constants |
|---|
| From class `https://developer.android.com/reference/android/graphics/Canvas` |---|---| | `int` | `https://developer.android.com/reference/android/graphics/Canvas#ALL_SAVE_FLAG` Restore everything when restore() is called (standard save flags). | |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#disableZ()() ` Disables Z support, preventing any RenderNodes drawn after this point from being visually reordered or having shadows rendered. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawARGB(int,%20int,%20int,%20int)(int a, int r, int g, int b) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified ARGB color, using srcover porterduff mode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawArc(float,%20float,%20float,%20float,%20float,%20float,%20boolean,%20android.graphics.Paint)(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, https://developer.android.com/reference/android/graphics/Paint paint) ` <br /> Draw the specified arc, which will be scaled to fit inside the specified oval. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawArc(android.graphics.RectF,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF oval, float startAngle, float sweepAngle, boolean useCenter, https://developer.android.com/reference/android/graphics/Paint paint) ` <br /> Draw the specified arc, which will be scaled to fit inside the specified oval. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Matrix,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Matrix matrix, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the bitmap using the specified matrix. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(int[],%20int,%20int,%20float,%20float,%20int,%20int,%20boolean,%20android.graphics.Paint)(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method is deprecated. checkstyle* |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20boolean,%20android.graphics.Paint)(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method is deprecated. checkstyle* |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Rect src, https://developer.android.com/reference/android/graphics/Rect dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(android.graphics.Bitmap,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, float left, float top, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, with its top/left corner at (x,y), using the specified paint, transformed by the current matrix. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Rect src, https://developer.android.com/reference/android/graphics/RectF dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawBitmapMesh(android.graphics.Bitmap,%20int,%20int,%20float[],%20int,%20int[],%20int,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawCircle(float,%20float,%20float,%20android.graphics.Paint)(float cx, float cy, float radius, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified circle using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawColor(long,%20android.graphics.BlendMode)(long color, https://developer.android.com/reference/android/graphics/BlendMode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawColor(int)(int color) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawColor(int,%20android.graphics.BlendMode)(int color, https://developer.android.com/reference/android/graphics/BlendMode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawColor(int,%20android.graphics.PorterDuff.Mode)(int color, https://developer.android.com/reference/android/graphics/PorterDuff.Mode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and porter-duff xfermode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawDoubleRoundRect(android.graphics.RectF,%20float[],%20android.graphics.RectF,%20float[],%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF outer, float[] outerRadii, https://developer.android.com/reference/android/graphics/RectF inner, float[] innerRadii, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a double rounded rectangle using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawDoubleRoundRect(android.graphics.RectF,%20float,%20float,%20android.graphics.RectF,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF outer, float outerRx, float outerRy, https://developer.android.com/reference/android/graphics/RectF inner, float innerRx, float innerRy, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a double rounded rectangle using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawGlyphs(int[],%20int,%20float[],%20int,%20int,%20android.graphics.fonts.Font,%20android.graphics.Paint)(int[] glyphIds, int glyphIdOffset, float[] positions, int positionOffset, int glyphCount, https://developer.android.com/reference/android/graphics/fonts/Font font, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw array of glyphs with specified font. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawLine(float,%20float,%20float,%20float,%20android.graphics.Paint)(float startX, float startY, float stopX, float stopY, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a line segment with the specified start and stop x,y coordinates, using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawLines(float[],%20int,%20int,%20android.graphics.Paint)(float[] pts, int offset, int count, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a series of lines. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawLines(float[],%20android.graphics.Paint)(float[] pts, https://developer.android.com/reference/android/graphics/Paint paint) ` |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawMesh(android.graphics.Mesh,%20android.graphics.BlendMode,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Mesh mesh, https://developer.android.com/reference/android/graphics/BlendMode blendMode, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a mesh object to the screen. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawOval(float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified oval using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawOval(android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF oval, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified oval using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPaint(android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Paint paint) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPatch(android.graphics.NinePatch,%20android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/NinePatch patch, https://developer.android.com/reference/android/graphics/RectF dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is ignored. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPatch(android.graphics.NinePatch,%20android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/NinePatch patch, https://developer.android.com/reference/android/graphics/Rect dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is ignored. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPath(android.graphics.Path,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Path path, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified path using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPicture(android.graphics.Picture,%20android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Picture picture, https://developer.android.com/reference/android/graphics/Rect dst) ` Draw the picture, stretched to fit into the dst rectangle. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPicture(android.graphics.Picture,%20android.graphics.RectF)(https://developer.android.com/reference/android/graphics/Picture picture, https://developer.android.com/reference/android/graphics/RectF dst) ` Draw the picture, stretched to fit into the dst rectangle. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPicture(android.graphics.Picture)(https://developer.android.com/reference/android/graphics/Picture picture) ` Save the canvas state, draw the picture, and restore the canvas state. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPoint(float,%20float,%20android.graphics.Paint)(float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Helper for drawPoints() for drawing a single point. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPoints(float[],%20int,%20int,%20android.graphics.Paint)(float[] pts, int offset, int count, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a series of points. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPoints(float[],%20android.graphics.Paint)(float[] pts, https://developer.android.com/reference/android/graphics/Paint paint) ` Helper for drawPoints() that assumes you want to draw the entire array |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPosText(java.lang.String,%20float[],%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, float[] pos, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method is deprecated. checkstyle* |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawPosText(char[],%20int,%20int,%20float[],%20android.graphics.Paint)(char[] text, int index, int count, float[] pos, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method is deprecated. checkstyle* |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRGB(int,%20int,%20int)(int r, int g, int b) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified RGB color, using srcover porterduff mode. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRect(float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRect(android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Rect r, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified Paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRect(android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF rect, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRegion(android.graphics.Region,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Region region, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the given region using the given paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRenderNode(android.graphics.RenderNode)(https://developer.android.com/reference/android/graphics/RenderNode renderNode) ` Draws the specified display list onto this canvas. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRoundRect(android.graphics.RectF,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF rect, float rx, float ry, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified round-rect using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawRoundRect(float,%20float,%20float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, float rx, float ry, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified round-rect using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawText(java.lang.CharSequence,%20int,%20int,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/CharSequence text, int start, int end, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified range of text, specified by start/end, with its origin at (x,y), in the specified Paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawText(java.lang.String,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawText(java.lang.String,%20int,%20int,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, int start, int end, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawText(char[],%20int,%20int,%20float,%20float,%20android.graphics.Paint)(char[] text, int index, int count, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawTextOnPath(java.lang.String,%20android.graphics.Path,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/android/graphics/Path path, float hOffset, float vOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint, along the specified path. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawTextOnPath(char[],%20int,%20int,%20android.graphics.Path,%20float,%20float,%20android.graphics.Paint)(char[] text, int index, int count, https://developer.android.com/reference/android/graphics/Path path, float hOffset, float vOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint, along the specified path. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawTextRun(android.graphics.text.MeasuredText,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/text/MeasuredText measuredText, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawTextRun(char[],%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#drawVertices(android.graphics.Canvas.VertexMode,%20int,%20float[],%20int,%20float[],%20int,%20int[],%20int,%20short[],%20int,%20int,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Canvas.VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the array of vertices, interpreted as triangles (based on mode). |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#enableZ()() ` <br /> Enables Z support which defaults to disabled. |
| ` int` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#getHeight()() ` Returns the height of the current drawing layer |
| ` int` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#getMaximumBitmapHeight()() ` Returns the maximum allowed height for bitmaps drawn with this canvas. |
| ` int` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#getMaximumBitmapWidth()() ` Returns the maximum allowed width for bitmaps drawn with this canvas. |
| ` int` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#getWidth()() ` Returns the width of the current drawing layer |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#isHardwareAccelerated()() ` Indicates whether this Canvas uses hardware acceleration. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#isOpaque()() ` Return true if the device that the current layer draws into is opaque (that is, it does not support per-pixel alpha). |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#setBitmap(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap) ` Specify a bitmap for the canvas to draw into. |
| ` void` | ` https://developer.android.com/reference/android/graphics/RecordingCanvas#setDensity(int)(int density) ` <br /> Specifies the density for this Canvas' backing bitmap. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/graphics/Canvas ` |---|---| | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutPath(android.graphics.Path)(https://developer.android.com/reference/android/graphics/Path path) ` Set the clip to the difference of the current clip and the specified path. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect rect) ` Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(float,%20float,%20float,%20float)(float left, float top, float right, float bottom) ` Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF rect) ` Set the clip to the difference of the current clip and the specified rectangle, which is expressed in local coordinates. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#clipOutShader(android.graphics.Shader)(https://developer.android.com/reference/android/graphics/Shader shader) ` Set the clip to the difference of the current clip and the shader. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipPath(android.graphics.Path,%20android.graphics.Region.Op)(https://developer.android.com/reference/android/graphics/Path path, https://developer.android.com/reference/android/graphics/Region.Op op) ` *This method was deprecated in API level 26. Region.Op values other than `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` have the ability to expand the clip. The canvas clipping APIs are intended to only expand the clip as a result of a restore operation. This enables a view parent to clip a canvas to clearly define the maximal drawing area of its children. The recommended alternative calls are `https://developer.android.com/reference/android/graphics/Canvas#clipPath(android.graphics.Path)` and `https://developer.android.com/reference/android/graphics/Canvas#clipOutPath(android.graphics.Path)`; As of API Level API level `https://developer.android.com/` only `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` are valid Region.Op parameters.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipPath(android.graphics.Path)(https://developer.android.com/reference/android/graphics/Path path) ` Intersect the current clip with the specified path. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(float,%20float,%20float,%20float,%20android.graphics.Region.Op)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Region.Op op) ` *This method was deprecated in API level 26. Region.Op values other than `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` have the ability to expand the clip. The canvas clipping APIs are intended to only expand the clip as a result of a restore operation. This enables a view parent to clip a canvas to clearly define the maximal drawing area of its children. The recommended alternative calls are `https://developer.android.com/reference/android/graphics/Canvas#clipRect(float,%20float,%20float,%20float)` and `https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(float,%20float,%20float,%20float)`; As of API Level API level `https://developer.android.com/` only `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` are valid Region.Op parameters.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF rect) ` Intersect the current clip with the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect rect) ` Intersect the current clip with the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.Rect,%20android.graphics.Region.Op)(https://developer.android.com/reference/android/graphics/Rect rect, https://developer.android.com/reference/android/graphics/Region.Op op) ` *This method was deprecated in API level 26. Region.Op values other than `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` have the ability to expand the clip. The canvas clipping APIs are intended to only expand the clip as a result of a restore operation. This enables a view parent to clip a canvas to clearly define the maximal drawing area of its children. The recommended alternative calls are `https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.Rect)` and `https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(android.graphics.Rect)`; As of API Level API level `https://developer.android.com/` only `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` are valid Region.Op parameters.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Intersect the current clip with the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(float,%20float,%20float,%20float)(float left, float top, float right, float bottom) ` Intersect the current clip with the specified rectangle, which is expressed in local coordinates. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.RectF,%20android.graphics.Region.Op)(https://developer.android.com/reference/android/graphics/RectF rect, https://developer.android.com/reference/android/graphics/Region.Op op) ` *This method was deprecated in API level 26. Region.Op values other than `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` have the ability to expand the clip. The canvas clipping APIs are intended to only expand the clip as a result of a restore operation. This enables a view parent to clip a canvas to clearly define the maximal drawing area of its children. The recommended alternative calls are `https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.RectF)` and `https://developer.android.com/reference/android/graphics/Canvas#clipOutRect(android.graphics.RectF)`; As of API Level API level `https://developer.android.com/` only `https://developer.android.com/reference/android/graphics/Region.Op#INTERSECT` and `https://developer.android.com/reference/android/graphics/Region.Op#DIFFERENCE` are valid Region.Op parameters.* | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#clipShader(android.graphics.Shader)(https://developer.android.com/reference/android/graphics/Shader shader) ` Intersect the current clip with the specified shader. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#concat(android.graphics.Matrix44)(https://developer.android.com/reference/android/graphics/Matrix44 m) ` Preconcat the current matrix with the specified matrix. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#concat(android.graphics.Matrix)(https://developer.android.com/reference/android/graphics/Matrix matrix) ` Preconcat the current matrix with the specified matrix. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#disableZ()() ` Disables Z support, preventing any RenderNodes drawn after this point from being visually reordered or having shadows rendered. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawARGB(int,%20int,%20int,%20int)(int a, int r, int g, int b) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified ARGB color, using srcover porterduff mode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawArc(float,%20float,%20float,%20float,%20float,%20float,%20boolean,%20android.graphics.Paint)(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, https://developer.android.com/reference/android/graphics/Paint paint) ` <br /> Draw the specified arc, which will be scaled to fit inside the specified oval. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawArc(android.graphics.RectF,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF oval, float startAngle, float sweepAngle, boolean useCenter, https://developer.android.com/reference/android/graphics/Paint paint) ` <br /> Draw the specified arc, which will be scaled to fit inside the specified oval. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Matrix,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Matrix matrix, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the bitmap using the specified matrix. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(int[],%20int,%20int,%20float,%20float,%20int,%20int,%20boolean,%20android.graphics.Paint)(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method was deprecated in API level 21. Usage with a `https://developer.android.com/reference/android/graphics/Canvas#isHardwareAccelerated()` canvas requires an internal copy of color buffer contents every time this method is called. Using a Bitmap avoids this copy, and allows the application to more explicitly control the lifetime and copies of pixel data.* | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20boolean,%20android.graphics.Paint)(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method was deprecated in API level 21. Usage with a `https://developer.android.com/reference/android/graphics/Canvas#isHardwareAccelerated()` canvas requires an internal copy of color buffer contents every time this method is called. Using a Bitmap avoids this copy, and allows the application to more explicitly control the lifetime and copies of pixel data.* | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Rect src, https://developer.android.com/reference/android/graphics/Rect dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, https://developer.android.com/reference/android/graphics/Rect src, https://developer.android.com/reference/android/graphics/RectF dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmap(android.graphics.Bitmap,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, float left, float top, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified bitmap, with its top/left corner at (x,y), using the specified paint, transformed by the current matrix. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawBitmapMesh(android.graphics.Bitmap,%20int,%20int,%20float[],%20int,%20int[],%20int,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawCircle(float,%20float,%20float,%20android.graphics.Paint)(float cx, float cy, float radius, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified circle using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawColor(long,%20android.graphics.BlendMode)(long color, https://developer.android.com/reference/android/graphics/BlendMode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawColor(int)(int color) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawColor(int,%20android.graphics.BlendMode)(int color, https://developer.android.com/reference/android/graphics/BlendMode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and blendmode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawColor(long)(long color) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawColor(int,%20android.graphics.PorterDuff.Mode)(int color, https://developer.android.com/reference/android/graphics/PorterDuff.Mode mode) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified color and porter-duff xfermode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawDoubleRoundRect(android.graphics.RectF,%20float[],%20android.graphics.RectF,%20float[],%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF outer, float[] outerRadii, https://developer.android.com/reference/android/graphics/RectF inner, float[] innerRadii, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a double rounded rectangle using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawDoubleRoundRect(android.graphics.RectF,%20float,%20float,%20android.graphics.RectF,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF outer, float outerRx, float outerRy, https://developer.android.com/reference/android/graphics/RectF inner, float innerRx, float innerRy, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a double rounded rectangle using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawGlyphs(int[],%20int,%20float[],%20int,%20int,%20android.graphics.fonts.Font,%20android.graphics.Paint)(int[] glyphIds, int glyphIdOffset, float[] positions, int positionOffset, int glyphCount, https://developer.android.com/reference/android/graphics/fonts/Font font, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw array of glyphs with specified font. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawLine(float,%20float,%20float,%20float,%20android.graphics.Paint)(float startX, float startY, float stopX, float stopY, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a line segment with the specified start and stop x,y coordinates, using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawLines(float[],%20int,%20int,%20android.graphics.Paint)(float[] pts, int offset, int count, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a series of lines. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawLines(float[],%20android.graphics.Paint)(float[] pts, https://developer.android.com/reference/android/graphics/Paint paint) ` | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawMesh(android.graphics.Mesh,%20android.graphics.BlendMode,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Mesh mesh, https://developer.android.com/reference/android/graphics/BlendMode blendMode, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws a mesh object to the screen. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawOval(float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified oval using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawOval(android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF oval, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified oval using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPaint(android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Paint paint) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPatch(android.graphics.NinePatch,%20android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/NinePatch patch, https://developer.android.com/reference/android/graphics/RectF dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is ignored. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPatch(android.graphics.NinePatch,%20android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/NinePatch patch, https://developer.android.com/reference/android/graphics/Rect dst, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the specified bitmap as an N-patch (most often, a 9-patch.) Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is ignored. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPath(android.graphics.Path,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Path path, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified path using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPicture(android.graphics.Picture,%20android.graphics.RectF)(https://developer.android.com/reference/android/graphics/Picture picture, https://developer.android.com/reference/android/graphics/RectF dst) ` Draw the picture, stretched to fit into the dst rectangle. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPicture(android.graphics.Picture)(https://developer.android.com/reference/android/graphics/Picture picture) ` Save the canvas state, draw the picture, and restore the canvas state. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPicture(android.graphics.Picture,%20android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Picture picture, https://developer.android.com/reference/android/graphics/Rect dst) ` Draw the picture, stretched to fit into the dst rectangle. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPoint(float,%20float,%20android.graphics.Paint)(float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Helper for drawPoints() for drawing a single point. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPoints(float[],%20android.graphics.Paint)(float[] pts, https://developer.android.com/reference/android/graphics/Paint paint) ` Helper for drawPoints() that assumes you want to draw the entire array | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPoints(float[],%20int,%20int,%20android.graphics.Paint)(float[] pts, int offset, int count, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a series of points. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPosText(java.lang.String,%20float[],%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, float[] pos, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method was deprecated in API level 16. This method does not support glyph composition and decomposition and should therefore not be used to render complex scripts. It also doesn't handle supplementary characters (eg emoji).* | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawPosText(char[],%20int,%20int,%20float[],%20android.graphics.Paint)(char[] text, int index, int count, float[] pos, https://developer.android.com/reference/android/graphics/Paint paint) ` *This method was deprecated in API level 16. This method does not support glyph composition and decomposition and should therefore not be used to render complex scripts. It also doesn't handle supplementary characters (eg emoji).* | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRGB(int,%20int,%20int)(int r, int g, int b) ` Fill the entire canvas' bitmap (restricted to the current clip) with the specified RGB color, using srcover porterduff mode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRect(float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRect(android.graphics.Rect,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Rect r, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified Paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRect(android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF rect, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified Rect using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRegion(android.graphics.Region,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Region region, https://developer.android.com/reference/android/graphics/Paint paint) ` Draws the given region using the given paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRenderNode(android.graphics.RenderNode)(https://developer.android.com/reference/android/graphics/RenderNode renderNode) ` Draws the given RenderNode. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRoundRect(android.graphics.RectF,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF rect, float rx, float ry, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified round-rect using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawRoundRect(float,%20float,%20float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, float rx, float ry, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified round-rect using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawText(java.lang.CharSequence,%20int,%20int,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/CharSequence text, int start, int end, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the specified range of text, specified by start/end, with its origin at (x,y), in the specified Paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawText(java.lang.String,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawText(char[],%20int,%20int,%20float,%20float,%20android.graphics.Paint)(char[] text, int index, int count, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawText(java.lang.String,%20int,%20int,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, int start, int end, float x, float y, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawTextOnPath(java.lang.String,%20android.graphics.Path,%20float,%20float,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/String text, https://developer.android.com/reference/android/graphics/Path path, float hOffset, float vOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint, along the specified path. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawTextOnPath(char[],%20int,%20int,%20android.graphics.Path,%20float,%20float,%20android.graphics.Paint)(char[] text, int index, int count, https://developer.android.com/reference/android/graphics/Path path, float hOffset, float vOffset, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the text, with origin at (x,y), using the specified paint, along the specified path. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawTextRun(android.graphics.text.MeasuredText,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/text/MeasuredText text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawTextRun(char[],%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)(https://developer.android.com/reference/java/lang/CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw a run of text, all in a single direction, with optional context for complex text shaping. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#drawVertices(android.graphics.Canvas.VertexMode,%20int,%20float[],%20int,%20float[],%20int,%20int[],%20int,%20short[],%20int,%20int,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/Canvas.VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, https://developer.android.com/reference/android/graphics/Paint paint) ` Draw the array of vertices, interpreted as triangles (based on mode). | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#enableZ()() ` <br /> Enables Z support which defaults to disabled. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#getClipBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` Return the bounds of the current clip (in local coordinates) in the bounds parameter, and return true if it is non-empty. | | ` final https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/graphics/Canvas#getClipBounds()() ` Retrieve the bounds of the current clip (in local coordinates). | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getDensity()() ` <br /> Returns the target density of the canvas. | | ` https://developer.android.com/reference/android/graphics/DrawFilter` | ` https://developer.android.com/reference/android/graphics/Canvas#getDrawFilter()() ` | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getHeight()() ` Returns the height of the current drawing layer | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#getMatrix(android.graphics.Matrix)(https://developer.android.com/reference/android/graphics/Matrix ctm) ` *This method was deprecated in API level 16. `https://developer.android.com/reference/android/graphics/Canvas#isHardwareAccelerated()` canvases may have any matrix when passed to a View or Drawable, as it is implementation defined where in the hierarchy such canvases are created. It is recommended in such cases to either draw contents irrespective of the current matrix, or to track relevant transform state outside of the canvas.* | | ` final https://developer.android.com/reference/android/graphics/Matrix` | ` https://developer.android.com/reference/android/graphics/Canvas#getMatrix()() ` *This method was deprecated in API level 16. `https://developer.android.com/reference/android/graphics/Canvas#isHardwareAccelerated()` canvases may have any matrix when passed to a View or Drawable, as it is implementation defined where in the hierarchy such canvases are created. It is recommended in such cases to either draw contents irrespective of the current matrix, or to track relevant transform state outside of the canvas.* | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getMaximumBitmapHeight()() ` Returns the maximum allowed height for bitmaps drawn with this canvas. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getMaximumBitmapWidth()() ` Returns the maximum allowed width for bitmaps drawn with this canvas. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getSaveCount()() ` Returns the number of matrix/clip states on the Canvas' private stack. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#getWidth()() ` Returns the width of the current drawing layer | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#isHardwareAccelerated()() ` Indicates whether this Canvas uses hardware acceleration. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#isOpaque()() ` Return true if the device that the current layer draws into is opaque (that is, it does not support per-pixel alpha). | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(float,%20float,%20float,%20float,%20android.graphics.Canvas.EdgeType)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Canvas.EdgeType type) ` *This method was deprecated in API level 30. The EdgeType is ignored. Use `https://developer.android.com/reference/android/graphics/Canvas#quickReject(float,%20float,%20float,%20float)` instead.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.Path)(https://developer.android.com/reference/android/graphics/Path path) ` Return true if the specified path, after being transformed by the current matrix, would lie completely outside of the current clip. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.RectF)(https://developer.android.com/reference/android/graphics/RectF rect) ` Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.RectF,%20android.graphics.Canvas.EdgeType)(https://developer.android.com/reference/android/graphics/RectF rect, https://developer.android.com/reference/android/graphics/Canvas.EdgeType type) ` *This method was deprecated in API level 30. The EdgeType is ignored. Use `https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.RectF)` instead.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.Path,%20android.graphics.Canvas.EdgeType)(https://developer.android.com/reference/android/graphics/Path path, https://developer.android.com/reference/android/graphics/Canvas.EdgeType type) ` *This method was deprecated in API level 30. The EdgeType is ignored. Use `https://developer.android.com/reference/android/graphics/Canvas#quickReject(android.graphics.Path)` instead.* | | ` boolean` | ` https://developer.android.com/reference/android/graphics/Canvas#quickReject(float,%20float,%20float,%20float)(float left, float top, float right, float bottom) ` Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. | | ` void` | ` https://developer.android.com/reference/android/graphics/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. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#restoreToCount(int)(int saveCount) ` Efficient way to pop any calls to save() that happened after the save count reached saveCount. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#rotate(float)(float degrees) ` Preconcat the current matrix with the specified rotation. | | ` final void` | ` https://developer.android.com/reference/android/graphics/Canvas#rotate(float,%20float,%20float)(float degrees, float px, float py) ` Preconcat the current matrix with the specified rotation. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#save()() ` Saves the current matrix and clip onto a private stack. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayer(android.graphics.RectF,%20android.graphics.Paint,%20int)(https://developer.android.com/reference/android/graphics/RectF bounds, https://developer.android.com/reference/android/graphics/Paint paint, int saveFlags) ` *This method was deprecated in API level 26. Use `https://developer.android.com/reference/android/graphics/Canvas#saveLayer(android.graphics.RectF,%20android.graphics.Paint)` instead.* | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayer(android.graphics.RectF,%20android.graphics.Paint)(https://developer.android.com/reference/android/graphics/RectF bounds, https://developer.android.com/reference/android/graphics/Paint paint) ` This behaves the same as save(), but in addition it allocates and redirects drawing to an offscreen rendering target. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayer(float,%20float,%20float,%20float,%20android.graphics.Paint)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint) ` Convenience for `https://developer.android.com/reference/android/graphics/Canvas#saveLayer(android.graphics.RectF,%20android.graphics.Paint)` that takes the four float coordinates of the bounds rectangle. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayer(float,%20float,%20float,%20float,%20android.graphics.Paint,%20int)(float left, float top, float right, float bottom, https://developer.android.com/reference/android/graphics/Paint paint, int saveFlags) ` *This method was deprecated in API level 26. Use `https://developer.android.com/reference/android/graphics/Canvas#saveLayer(float,%20float,%20float,%20float,%20android.graphics.Paint)` instead.* | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(float,%20float,%20float,%20float,%20int,%20int)(float left, float top, float right, float bottom, int alpha, int saveFlags) ` *This method was deprecated in API level 26. Use `https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(float,%20float,%20float,%20float,%20int)` instead.* | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(android.graphics.RectF,%20int)(https://developer.android.com/reference/android/graphics/RectF bounds, int alpha) ` Convenience for `https://developer.android.com/reference/android/graphics/Canvas#saveLayer(android.graphics.RectF,%20android.graphics.Paint)` but instead of taking a entire Paint object it takes only the `alpha` parameter. | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(android.graphics.RectF,%20int,%20int)(https://developer.android.com/reference/android/graphics/RectF bounds, int alpha, int saveFlags) ` *This method was deprecated in API level 26. Use `https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(android.graphics.RectF,%20int)` instead.* | | ` int` | ` https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(float,%20float,%20float,%20float,%20int)(float left, float top, float right, float bottom, int alpha) ` Convenience for `https://developer.android.com/reference/android/graphics/Canvas#saveLayerAlpha(android.graphics.RectF,%20int)` that takes the four float coordinates of the bounds rectangle. | | ` final void` | ` https://developer.android.com/reference/android/graphics/Canvas#scale(float,%20float,%20float,%20float)(float sx, float sy, float px, float py) ` Preconcat the current matrix with the specified scale. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#scale(float,%20float)(float sx, float sy) ` Preconcat the current matrix with the specified scale. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#setBitmap(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap) ` Specify a bitmap for the canvas to draw into. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#setDensity(int)(int density) ` <br /> Specifies the density for this Canvas' backing bitmap. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#setDrawFilter(android.graphics.DrawFilter)(https://developer.android.com/reference/android/graphics/DrawFilter filter) ` | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#setMatrix(android.graphics.Matrix)(https://developer.android.com/reference/android/graphics/Matrix matrix) ` Completely replace the current matrix with the specified matrix. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#skew(float,%20float)(float sx, float sy) ` Preconcat the current matrix with the specified skew. | | ` void` | ` https://developer.android.com/reference/android/graphics/Canvas#translate(float,%20float)(float dx, float dy) ` Preconcat the current matrix with the specified translation | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### disableZ

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void disableZ ()
```

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

Note: This is not impacted by any `https://developer.android.com/reference/android/graphics/Canvas#save()` or `https://developer.android.com/reference/android/graphics/Canvas#restore()` calls as it is not
considered to be part of the current matrix or clip.

See `https://developer.android.com/reference/android/graphics/Canvas#enableZ()`

<br />

### drawARGB

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawARGB (int a, 
                int r, 
                int g, 
                int b)
```

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

<br />

| Parameters ||
|---|---|
| `a` | `int`: alpha component (0..255) of the color to draw onto the canvas <br /> |
| `r` | `int`: red component (0..255) of the color to draw onto the canvas <br /> |
| `g` | `int`: green component (0..255) of the color to draw onto the canvas <br /> |
| `b` | `int`: blue component (0..255) of the color to draw onto the canvas <br /> |

### drawArc

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawArc (float left, 
                float top, 
                float right, 
                float bottom, 
                float startAngle, 
                float sweepAngle, 
                boolean useCenter, 
                Paint paint)
```

<br />


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


If the start angle is negative or \>= 360, the start angle is treated as start angle modulo
360.


If the sweep angle is \>= 360, then the oval is drawn completely. Note that this differs
slightly from SkPath::arcTo, which treats the sweep angle modulo 360. If the sweep angle is
negative, the sweep angle is treated as sweep angle modulo 360


The arc is drawn clockwise. An angle of 0 degrees correspond to the geometric angle of 0
degrees (3 o'clock on a watch.)

<br />

<br />

| Parameters ||
|---|---|
| `left` | `float` <br /> |
| `top` | `float` <br /> |
| `right` | `float` <br /> |
| `bottom` | `float` <br /> |
| `startAngle` | `float`: Starting angle (in degrees) where the arc begins <br /> |
| `sweepAngle` | `float`: Sweep angle (in degrees) measured clockwise <br /> |
| `useCenter` | `boolean`: If true, include the center of the oval in the arc, and close it if it is being stroked. This will draw a wedge <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawArc

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawArc (RectF oval, 
                float startAngle, 
                float sweepAngle, 
                boolean useCenter, 
                Paint paint)
```

<br />


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


If the start angle is negative or \>= 360, the start angle is treated as start angle modulo
360.


If the sweep angle is \>= 360, then the oval is drawn completely. Note that this differs
slightly from SkPath::arcTo, which treats the sweep angle modulo 360. If the sweep angle is
negative, the sweep angle is treated as sweep angle modulo 360


The arc is drawn clockwise. An angle of 0 degrees correspond to the geometric angle of 0
degrees (3 o'clock on a watch.)

<br />

<br />

| Parameters ||
|---|---|
| `oval` | `RectF`: This value cannot be `null`. <br /> |
| `startAngle` | `float`: Starting angle (in degrees) where the arc begins <br /> |
| `sweepAngle` | `float`: Sweep angle (in degrees) measured clockwise <br /> |
| `useCenter` | `boolean`: If true, include the center of the oval in the arc, and close it if it is being stroked. This will draw a wedge <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (Bitmap bitmap, 
                Matrix matrix, 
                Paint paint)
```

Draw the bitmap using the specified matrix.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: This value cannot be `null`. <br /> |
| `matrix` | `Matrix`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (int[] colors, 
                int offset, 
                int stride, 
                float x, 
                float y, 
                int width, 
                int height, 
                boolean hasAlpha, 
                Paint paint)
```


**This method is deprecated.**   

checkstyle

Treat the specified array of colors as a bitmap, and draw it. This gives the same result as
first creating a bitmap from the array, and then drawing it, but this method avoids
explicitly creating a bitmap object which can be more efficient if the colors are changing
often.

<br />

| Parameters ||
|---|---|
| `colors` | `int`: This value cannot be `null`. <br /> |
| `offset` | `int`: Offset into the array of colors for the first pixel <br /> |
| `stride` | `int`: The number of colors in the array between rows (must be \>= width or \<= -width). <br /> |
| `x` | `float`: The X coordinate for where to draw the bitmap <br /> |
| `y` | `float`: The Y coordinate for where to draw the bitmap <br /> |
| `width` | `int`: The width of the bitmap <br /> |
| `height` | `int`: The height of the bitmap <br /> |
| `hasAlpha` | `boolean`: True if the alpha channel of the colors contains valid values. If false, the alpha byte is ignored (assumed to be 0xFF for every pixel). <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (int[] colors, 
                int offset, 
                int stride, 
                int x, 
                int y, 
                int width, 
                int height, 
                boolean hasAlpha, 
                Paint paint)
```


**This method is deprecated.**   

checkstyle

Legacy version of drawBitmap(int\[\] colors, ...) that took ints for x,y

<br />

| Parameters ||
|---|---|
| `colors` | `int`: This value cannot be `null`. <br /> |
| `offset` | `int` <br /> |
| `stride` | `int` <br /> |
| `x` | `int` <br /> |
| `y` | `int` <br /> |
| `width` | `int` <br /> |
| `height` | `int` <br /> |
| `hasAlpha` | `boolean` <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (Bitmap bitmap, 
                Rect src, 
                Rect dst, 
                Paint paint)
```

Draw the specified bitmap, scaling/translating automatically to fill the destination
rectangle. If the source rectangle is not null, it specifies the subset of the bitmap to
draw.


Note: if the paint contains a maskfilter that generates a mask which extends beyond the
bitmap's original width/height (e.g. BlurMaskFilter), then the bitmap will be drawn as if it
were in a Shader with CLAMP mode. Thus the color outside of the original width/height will be
the edge color replicated.


This function *ignores the density associated with the bitmap*. This is because the
source and destination rectangle coordinate spaces are in their respective densities, so must
already have the appropriate scaling factor applied.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: This value cannot be `null`. <br /> |
| `src` | `Rect`: This value may be `null`. <br /> |
| `dst` | `Rect`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (Bitmap bitmap, 
                float left, 
                float top, 
                Paint paint)
```

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


Note: if the paint contains a maskfilter that generates a mask which extends beyond the
bitmap's original width/height (e.g. BlurMaskFilter), then the bitmap will be drawn as if it
were in a Shader with CLAMP mode. Thus the color outside of the original width/height will be
the edge color replicated.


If the bitmap and canvas have different densities, this function will take care of
automatically scaling the bitmap to draw at the same density as the canvas.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: This value cannot be `null`. <br /> |
| `left` | `float`: The position of the left side of the bitmap being drawn <br /> |
| `top` | `float`: The position of the top side of the bitmap being drawn <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmap (Bitmap bitmap, 
                Rect src, 
                RectF dst, 
                Paint paint)
```

Draw the specified bitmap, scaling/translating automatically to fill the destination
rectangle. If the source rectangle is not null, it specifies the subset of the bitmap to
draw.


Note: if the paint contains a maskfilter that generates a mask which extends beyond the
bitmap's original width/height (e.g. BlurMaskFilter), then the bitmap will be drawn as if it
were in a Shader with CLAMP mode. Thus the color outside of the original width/height will be
the edge color replicated.


This function *ignores the density associated with the bitmap*. This is because the
source and destination rectangle coordinate spaces are in their respective densities, so must
already have the appropriate scaling factor applied.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: This value cannot be `null`. <br /> |
| `src` | `Rect`: This value may be `null`. <br /> |
| `dst` | `RectF`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawBitmapMesh

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawBitmapMesh (Bitmap bitmap, 
                int meshWidth, 
                int meshHeight, 
                float[] verts, 
                int vertOffset, 
                int[] colors, 
                int colorOffset, 
                Paint paint)
```

Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the
bitmap. There are meshWidth+1 vertices across, and meshHeight+1 vertices down. The verts
array is accessed in row-major order, so that the first meshWidth+1 vertices are distributed
across the top of the bitmap from left to right. A more general version of this method is
drawVertices().

Prior to API level `https://developer.android.com/` vertOffset and colorOffset were ignored,
effectively treating them as zeros. In API level `https://developer.android.com/` and above
these parameters will be respected.

Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is
ignored.

<br />

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: This value cannot be `null`. <br /> |
| `meshWidth` | `int`: The number of columns in the mesh. Nothing is drawn if this is 0 <br /> |
| `meshHeight` | `int`: The number of rows in the mesh. Nothing is drawn if this is 0 <br /> |
| `verts` | `float`: This value cannot be `null`. <br /> |
| `vertOffset` | `int`: Number of verts elements to skip before drawing <br /> |
| `colors` | `int`: This value may be `null`. <br /> |
| `colorOffset` | `int`: Number of color elements to skip before drawing <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawCircle

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawCircle (float cx, 
                float cy, 
                float radius, 
                Paint paint)
```

Draw the specified circle using the specified paint. If radius is \<= 0, then nothing will be
drawn. The circle will be filled or framed based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `cx` | `float`: The x-coordinate of the center of the circle to be drawn <br /> |
| `cy` | `float`: The y-coordinate of the center of the circle to be drawn <br /> |
| `radius` | `float`: The radius of the circle to be drawn <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawColor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawColor (long color, 
                BlendMode mode)
```

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

<br />

| Parameters ||
|---|---|
| `color` | `long`: the `ColorLong` to draw onto the canvas. See the `https://developer.android.com/reference/android/graphics/Color` class for details about `ColorLong`s. <br /> |
| `mode` | `BlendMode`: This value cannot be `null`. <br /> |

### drawColor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawColor (int color)
```

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

<br />

| Parameters ||
|---|---|
| `color` | `int`: the color to draw onto the canvas <br /> |

### drawColor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawColor (int color, 
                BlendMode mode)
```

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

<br />

| Parameters ||
|---|---|
| `color` | `int`: the color to draw onto the canvas <br /> |
| `mode` | `BlendMode`: This value cannot be `null`. <br /> |

### drawColor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawColor (int color, 
                PorterDuff.Mode mode)
```

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

<br />

| Parameters ||
|---|---|
| `color` | `int`: the color to draw onto the canvas <br /> |
| `mode` | `PorterDuff.Mode`: This value cannot be `null`. <br /> |

### drawDoubleRoundRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawDoubleRoundRect (RectF outer, 
                float[] outerRadii, 
                RectF inner, 
                float[] innerRadii, 
                Paint paint)
```

Draws a double rounded rectangle using the specified paint. The resultant round rect
will be filled in the area defined between the outer and inner rectangular bounds if
the `https://developer.android.com/reference/android/graphics/Paint` configured with `https://developer.android.com/reference/android/graphics/Paint.Style#FILL`.
Otherwise if `https://developer.android.com/reference/android/graphics/Paint.Style#STROKE` is used, then 2 rounded rect strokes will
be drawn at the outer and inner rounded rectangles

<br />

| Parameters ||
|---|---|
| `outer` | `RectF`: This value cannot be `null`. <br /> |
| `outerRadii` | `float`: This value cannot be `null`. <br /> |
| `inner` | `RectF`: This value cannot be `null`. <br /> |
| `innerRadii` | `float`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawDoubleRoundRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawDoubleRoundRect (RectF outer, 
                float outerRx, 
                float outerRy, 
                RectF inner, 
                float innerRx, 
                float innerRy, 
                Paint paint)
```

Draws a double rounded rectangle using the specified paint. The resultant round rect
will be filled in the area defined between the outer and inner rectangular bounds if
the `https://developer.android.com/reference/android/graphics/Paint` configured with `https://developer.android.com/reference/android/graphics/Paint.Style#FILL`.
Otherwise if `https://developer.android.com/reference/android/graphics/Paint.Style#STROKE` is used, then 2 rounded rect strokes will
be drawn at the outer and inner rounded rectangles

<br />

| Parameters ||
|---|---|
| `outer` | `RectF`: This value cannot be `null`. <br /> |
| `outerRx` | `float`: The x-radius of the oval used to round the corners on the outer rectangle <br /> |
| `outerRy` | `float`: The y-radius of the oval used to round the corners on the outer rectangle <br /> |
| `inner` | `RectF`: This value cannot be `null`. <br /> |
| `innerRx` | `float`: The x-radius of the oval used to round the corners on the inner rectangle <br /> |
| `innerRy` | `float`: The y-radius of the oval used to round the corners on the outer rectangle <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawGlyphs

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawGlyphs (int[] glyphIds, 
                int glyphIdOffset, 
                float[] positions, 
                int positionOffset, 
                int glyphCount, 
                Font font, 
                Paint paint)
```

Draw array of glyphs with specified font.

<br />

| Parameters ||
|---|---|
| `glyphIds` | `int`: This value cannot be `null`. <br /> |
| `glyphIdOffset` | `int`: Value is 0 or greater <br /> |
| `positions` | `float`: This value cannot be `null`. <br /> |
| `positionOffset` | `int`: Value is 0 or greater <br /> |
| `glyphCount` | `int`: Value is 0 or greater <br /> |
| `font` | `Font`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawLine

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawLine (float startX, 
                float startY, 
                float stopX, 
                float stopY, 
                Paint paint)
```

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


Note that since a line is always "framed", the Style is ignored in the paint.


Degenerate lines (length is 0) will not be drawn.

<br />

<br />

| Parameters ||
|---|---|
| `startX` | `float`: The x-coordinate of the start point of the line <br /> |
| `startY` | `float`: The y-coordinate of the start point of the line <br /> |
| `stopX` | `float` <br /> |
| `stopY` | `float` <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawLines

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawLines (float[] pts, 
                int offset, 
                int count, 
                Paint paint)
```

Draw a series of lines. Each line is taken from 4 consecutive values in the pts array. Thus
to draw 1 line, the array must contain at least 4 values. This is logically the same as
drawing the array as follows: drawLine(pts\[0\], pts\[1\], pts\[2\], pts\[3\]) followed by
drawLine(pts\[4\], pts\[5\], pts\[6\], pts\[7\]) and so on.

<br />

| Parameters ||
|---|---|
| `pts` | `float`: This value cannot be `null`. <br /> |
| `offset` | `int`: Number of values in the array to skip before drawing. <br /> |
| `count` | `int`: The number of values in the array to process, after skipping "offset" of them. Since each line uses 4 values, the number of "lines" that are drawn is really (count \>\> 2). <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawLines

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawLines (float[] pts, 
                Paint paint)
```

<br />

<br />

| Parameters ||
|---|---|
| `pts` | `float`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawMesh

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawMesh (Mesh mesh, 
                BlendMode blendMode, 
                Paint paint)
```

Draws a mesh object to the screen.

Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is
ignored.

<br />

<br />

| Parameters ||
|---|---|
| `mesh` | `Mesh`: This value cannot be `null`. <br /> |
| `blendMode` | `BlendMode`: This value may be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawOval

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawOval (float left, 
                float top, 
                float right, 
                float bottom, 
                Paint paint)
```

Draw the specified oval using the specified paint. The oval will be filled or framed based on
the Style in the paint.

<br />

| Parameters ||
|---|---|
| `left` | `float` <br /> |
| `top` | `float` <br /> |
| `right` | `float` <br /> |
| `bottom` | `float` <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawOval

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawOval (RectF oval, 
                Paint paint)
```

Draw the specified oval using the specified paint. The oval will be filled or framed based on
the Style in the paint.

<br />

| Parameters ||
|---|---|
| `oval` | `RectF`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPaint

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPaint (Paint paint)
```

Fill the entire canvas' bitmap (restricted to the current clip) with the specified paint.
This is equivalent (but faster) to drawing an infinitely large rectangle with the specified
paint.

<br />

| Parameters ||
|---|---|
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPatch

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPatch (NinePatch patch, 
                RectF dst, 
                Paint paint)
```

Draws the specified bitmap as an N-patch (most often, a 9-patch.)

Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is
ignored.

<br />

<br />

| Parameters ||
|---|---|
| `patch` | `NinePatch`: This value cannot be `null`. <br /> |
| `dst` | `RectF`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawPatch

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPatch (NinePatch patch, 
                Rect dst, 
                Paint paint)
```

Draws the specified bitmap as an N-patch (most often, a 9-patch.)

Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is
ignored.

<br />

<br />

| Parameters ||
|---|---|
| `patch` | `NinePatch`: This value cannot be `null`. <br /> |
| `dst` | `Rect`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value may be `null`. <br /> |

### drawPath

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPath (Path path, 
                Paint paint)
```

Draw the specified path using the specified paint. The path will be filled or framed based on
the Style in the paint.

<br />

| Parameters ||
|---|---|
| `path` | `Path`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPicture

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPicture (Picture picture, 
                Rect dst)
```

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

<br />

| Parameters ||
|---|---|
| `picture` | `Picture`: This value cannot be `null`. <br /> |
| `dst` | `Rect`: This value cannot be `null`. <br /> |

### drawPicture

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPicture (Picture picture, 
                RectF dst)
```

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

<br />

| Parameters ||
|---|---|
| `picture` | `Picture`: This value cannot be `null`. <br /> |
| `dst` | `RectF`: This value cannot be `null`. <br /> |

### drawPicture

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPicture (Picture picture)
```

Save the canvas state, draw the picture, and restore the canvas state.
This differs from picture.draw(canvas), which does not perform any
save/restore.


**Note:** This forces the picture to internally call
`https://developer.android.com/reference/android/graphics/Picture#endRecording()` in order to prepare for playback.

<br />

| Parameters ||
|---|---|
| `picture` | `Picture`: This value cannot be `null`. <br /> |

### drawPoint

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPoint (float x, 
                float y, 
                Paint paint)
```

Helper for drawPoints() for drawing a single point.

<br />

| Parameters ||
|---|---|
| `x` | `float` <br /> |
| `y` | `float` <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPoints

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPoints (float[] pts, 
                int offset, 
                int count, 
                Paint paint)
```

Draw a series of points. Each point is centered at the coordinate specified by pts\[\], and its
diameter is specified by the paint's stroke width (as transformed by the canvas' CTM), with
special treatment for a stroke width of 0, which always draws exactly 1 pixel (or at most 4
if antialiasing is enabled). The shape of the point is controlled by the paint's Cap type.
The shape is a square, unless the cap type is Round, in which case the shape is a circle.

<br />

| Parameters ||
|---|---|
| `pts` | `float`: Array of points to draw \[x0 y0 x1 y1 x2 y2 ...\] <br /> |
| `offset` | `int`: Number of values to skip before starting to draw. <br /> |
| `count` | `int`: The number of values to process, after skipping offset of them. Since one point uses two values, the number of "points" that are drawn is really (count \>\> 1). <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPoints

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPoints (float[] pts, 
                Paint paint)
```

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

<br />

| Parameters ||
|---|---|
| `pts` | `float`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPosText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPosText (String text, 
                float[] pos, 
                Paint paint)
```


**This method is deprecated.**   

checkstyle

Draw the text in the array, with each character's origin specified by the pos array.

<br />

| Parameters ||
|---|---|
| `text` | `String`: This value cannot be `null`. <br /> |
| `pos` | `float`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawPosText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawPosText (char[] text, 
                int index, 
                int count, 
                float[] pos, 
                Paint paint)
```


**This method is deprecated.**   

checkstyle

Draw the text in the array, with each character's origin specified by the pos array.

<br />

| Parameters ||
|---|---|
| `text` | `char`: This value cannot be `null`. <br /> |
| `index` | `int`: The index of the first character to draw <br /> |
| `count` | `int`: The number of characters to draw, starting from index. <br /> |
| `pos` | `float`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRGB

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRGB (int r, 
                int g, 
                int b)
```

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

<br />

| Parameters ||
|---|---|
| `r` | `int`: red component (0..255) of the color to draw onto the canvas <br /> |
| `g` | `int`: green component (0..255) of the color to draw onto the canvas <br /> |
| `b` | `int`: blue component (0..255) of the color to draw onto the canvas <br /> |

### drawRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRect (float left, 
                float top, 
                float right, 
                float bottom, 
                Paint paint)
```

Draw the specified Rect using the specified paint. The rectangle will be filled or framed
based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `left` | `float`: The left side of the rectangle to be drawn <br /> |
| `top` | `float`: The top side of the rectangle to be drawn <br /> |
| `right` | `float`: The right side of the rectangle to be drawn <br /> |
| `bottom` | `float`: The bottom side of the rectangle to be drawn <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRect (Rect r, 
                Paint paint)
```

Draw the specified Rect using the specified Paint. The rectangle will be filled or framed
based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `r` | `Rect`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRect (RectF rect, 
                Paint paint)
```

Draw the specified Rect using the specified paint. The rectangle will be filled or framed
based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `rect` | `RectF`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRegion

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRegion (Region region, 
                Paint paint)
```

Draws the given region using the given paint.

<br />

| Parameters ||
|---|---|
| `region` | `Region`: This value cannot be `null`. <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRenderNode

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRenderNode (RenderNode renderNode)
```

Draws the specified display list onto this canvas.

<br />

| Parameters ||
|---|---|
| `renderNode` | `RenderNode`: The RenderNode to draw. This value cannot be `null`. <br /> |

### drawRoundRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRoundRect (RectF rect, 
                float rx, 
                float ry, 
                Paint paint)
```

Draw the specified round-rect using the specified paint. The roundrect will be filled or
framed based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `rect` | `RectF`: This value cannot be `null`. <br /> |
| `rx` | `float`: The x-radius of the oval used to round the corners <br /> |
| `ry` | `float`: The y-radius of the oval used to round the corners <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawRoundRect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawRoundRect (float left, 
                float top, 
                float right, 
                float bottom, 
                float rx, 
                float ry, 
                Paint paint)
```

Draw the specified round-rect using the specified paint. The roundrect will be filled or
framed based on the Style in the paint.

<br />

| Parameters ||
|---|---|
| `left` | `float` <br /> |
| `top` | `float` <br /> |
| `right` | `float` <br /> |
| `bottom` | `float` <br /> |
| `rx` | `float`: The x-radius of the oval used to round the corners <br /> |
| `ry` | `float`: The y-radius of the oval used to round the corners <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawText (CharSequence text, 
                int start, 
                int end, 
                float x, 
                float y, 
                Paint paint)
```

Draw the specified range of text, specified by start/end, with its origin at (x,y), in the
specified Paint. The origin is interpreted based on the Align setting in the Paint.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence`: This value cannot be `null`. <br /> |
| `start` | `int`: The index of the first character in text to draw <br /> |
| `end` | `int`: (end - 1) is the index of the last character in text to draw <br /> |
| `x` | `float`: The x-coordinate of origin for where to draw the text <br /> |
| `y` | `float`: The y-coordinate of origin for where to draw the text <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawText (String text, 
                float x, 
                float y, 
                Paint paint)
```

Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted
based on the Align setting in the paint.

<br />

| Parameters ||
|---|---|
| `text` | `String`: This value cannot be `null`. <br /> |
| `x` | `float`: The x-coordinate of the origin of the text being drawn <br /> |
| `y` | `float`: The y-coordinate of the baseline of the text being drawn <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawText (String text, 
                int start, 
                int end, 
                float x, 
                float y, 
                Paint paint)
```

Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted
based on the Align setting in the paint.

<br />

| Parameters ||
|---|---|
| `text` | `String`: This value cannot be `null`. <br /> |
| `start` | `int`: The index of the first character in text to draw <br /> |
| `end` | `int`: (end - 1) is the index of the last character in text to draw <br /> |
| `x` | `float`: The x-coordinate of the origin of the text being drawn <br /> |
| `y` | `float`: The y-coordinate of the baseline of the text being drawn <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawText

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawText (char[] text, 
                int index, 
                int count, 
                float x, 
                float y, 
                Paint paint)
```

Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted
based on the Align setting in the paint.

<br />

| Parameters ||
|---|---|
| `text` | `char`: This value cannot be `null`. <br /> |
| `index` | `int` <br /> |
| `count` | `int` <br /> |
| `x` | `float`: The x-coordinate of the origin of the text being drawn <br /> |
| `y` | `float`: The y-coordinate of the baseline of the text being drawn <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawTextOnPath

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawTextOnPath (String text, 
                Path path, 
                float hOffset, 
                float vOffset, 
                Paint paint)
```

Draw the text, with origin at (x,y), using the specified paint, along the specified path. The
paint's Align setting determines where along the path to start the text.

<br />

| Parameters ||
|---|---|
| `text` | `String`: This value cannot be `null`. <br /> |
| `path` | `Path`: This value cannot be `null`. <br /> |
| `hOffset` | `float`: The distance along the path to add to the text's starting position <br /> |
| `vOffset` | `float`: The distance above(-) or below(+) the path to position the text <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawTextOnPath

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawTextOnPath (char[] text, 
                int index, 
                int count, 
                Path path, 
                float hOffset, 
                float vOffset, 
                Paint paint)
```

Draw the text, with origin at (x,y), using the specified paint, along the specified path. The
paint's Align setting determines where along the path to start the text.

<br />

| Parameters ||
|---|---|
| `text` | `char`: This value cannot be `null`. <br /> |
| `index` | `int`: The starting index within the text to be drawn <br /> |
| `count` | `int`: Starting from index, the number of characters to draw <br /> |
| `path` | `Path`: This value cannot be `null`. <br /> |
| `hOffset` | `float`: The distance along the path to add to the text's starting position <br /> |
| `vOffset` | `float`: The distance above(-) or below(+) the path to position the text <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawTextRun

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawTextRun (MeasuredText measuredText, 
                int start, 
                int end, 
                int contextStart, 
                int contextEnd, 
                float x, 
                float y, 
                boolean isRtl, 
                Paint paint)
```

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


See `https://developer.android.com/reference/android/graphics/Canvas#drawTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)` for
more details. This method uses a `https://developer.android.com/reference/android/graphics/text/MeasuredText` rather than CharSequence to represent
the string.

<br />

| Parameters ||
|---|---|
| `measuredText` | `MeasuredText`: This value cannot be `null`. <br /> |
| `start` | `int`: the start of the text to render. Data before this position can be used for shaping context. <br /> |
| `end` | `int`: the end of the text to render. Data at or after this position can be used for shaping context. <br /> |
| `contextStart` | `int`: the index of the start of the shaping context <br /> |
| `contextEnd` | `int`: the index of the end of the shaping context <br /> |
| `x` | `float`: the x position at which to draw the text <br /> |
| `y` | `float`: the y position at which to draw the text <br /> |
| `isRtl` | `boolean`: whether the run is in RTL direction <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawTextRun

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawTextRun (char[] text, 
                int index, 
                int count, 
                int contextIndex, 
                int contextCount, 
                float x, 
                float y, 
                boolean isRtl, 
                Paint paint)
```

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


See `https://developer.android.com/reference/android/graphics/Canvas#drawTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)` for
more details. This method uses a character array rather than CharSequence to represent the
string. Also, to be consistent with the pattern established in `https://developer.android.com/reference/android/graphics/Canvas#drawText(char[],%20int,%20int,%20float,%20float,%20android.graphics.Paint)`, in this
method `count` and `contextCount` are used rather than offsets of the end
position; `count = end - start, contextCount = contextEnd -
contextStart`.

<br />

| Parameters ||
|---|---|
| `text` | `char`: This value cannot be `null`. <br /> |
| `index` | `int`: the start of the text to render <br /> |
| `count` | `int`: the count of chars to render <br /> |
| `contextIndex` | `int`: the start of the context for shaping. Must be no greater than index. <br /> |
| `contextCount` | `int`: the number of characters in the context for shaping. contexIndex + contextCount must be no less than index + count. <br /> |
| `x` | `float`: the x position at which to draw the text <br /> |
| `y` | `float`: the y position at which to draw the text <br /> |
| `isRtl` | `boolean`: whether the run is in RTL direction <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawTextRun

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawTextRun (CharSequence text, 
                int start, 
                int end, 
                int contextStart, 
                int contextEnd, 
                float x, 
                float y, 
                boolean isRtl, 
                Paint paint)
```

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


The run of text includes the characters from `start` to `end` in the text. In
addition, the range `contextStart` to `contextEnd` is used as context for the
purpose of complex text shaping, such as Arabic text potentially shaped differently based on
the text next to it.


All text outside the range `contextStart..contextEnd` is ignored. The text between
`start` and `end` will be laid out and drawn. The context range is useful for
contextual shaping, e.g. Kerning, Arabic contextural form.


The direction of the run is explicitly specified by `isRtl`. Thus, this method is
suitable only for runs of a single direction. Alignment of the text is as determined by the
Paint's TextAlign value. Further, `0 <= contextStart <= start <= end <= contextEnd
<= text.length` must hold on entry.


Also see `https://developer.android.com/reference/android/graphics/Paint#getRunAdvance(char[],%20int,%20int,%20int,%20int,%20boolean,%20int)` for a corresponding method to measure
the text; the advance width of the text drawn matches the value obtained from that method.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence`: This value cannot be `null`. <br /> |
| `start` | `int`: the start of the text to render. Data before this position can be used for shaping context. <br /> |
| `end` | `int`: the end of the text to render. Data at or after this position can be used for shaping context. <br /> |
| `contextStart` | `int`: the index of the start of the shaping context <br /> |
| `contextEnd` | `int`: the index of the end of the shaping context <br /> |
| `x` | `float`: the x position at which to draw the text <br /> |
| `y` | `float`: the y position at which to draw the text <br /> |
| `isRtl` | `boolean`: whether the run is in RTL direction <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### drawVertices

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void drawVertices (Canvas.VertexMode mode, 
                int vertexCount, 
                float[] verts, 
                int vertOffset, 
                float[] texs, 
                int texOffset, 
                int[] colors, 
                int colorOffset, 
                short[] indices, 
                int indexOffset, 
                int indexCount, 
                Paint paint)
```

Draw the array of vertices, interpreted as triangles (based on mode). The verts array is
required, and specifies the x,y pairs for each vertex. If texs is non-null, then it is used
to specify the coordinate in shader coordinates to use at each vertex (the paint must have a
shader in this case). If there is no texs array, but there is a color array, then each color
is interpolated across its corresponding triangle in a gradient. If both texs and colors
arrays are present, then they behave as before, but the resulting color at each pixels is the
result of multiplying the colors from the shader and the color-gradient together. The indices
array is optional, but if it is present, then it is used to specify the index of each
triangle, rather than just walking through the arrays in order.

Note: antialiasing is not supported, therefore `https://developer.android.com/reference/android/graphics/Paint#ANTI_ALIAS_FLAG` is
ignored.

<br />

<br />

| Parameters ||
|---|---|
| `mode` | `Canvas.VertexMode`: This value cannot be `null`. <br /> |
| `vertexCount` | `int`: The number of values in the vertices array (and corresponding texs and colors arrays if non-null). Each logical vertex is two values (x, y), vertexCount must be a multiple of 2. <br /> |
| `verts` | `float`: This value cannot be `null`. <br /> |
| `vertOffset` | `int`: Number of values in the verts to skip before drawing. <br /> |
| `texs` | `float`: This value may be `null`. <br /> |
| `texOffset` | `int`: Number of values in texs to skip before drawing. <br /> |
| `colors` | `int`: This value may be `null`. <br /> |
| `colorOffset` | `int`: Number of values in colors to skip before drawing. <br /> |
| `indices` | `short`: This value may be `null`. <br /> |
| `indexOffset` | `int` <br /> |
| `indexCount` | `int`: Number of entries in the indices array (if not null). <br /> |
| `paint` | `Paint`: This value cannot be `null`. <br /> |

### enableZ

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enableZ ()
```

<br />

Enables Z support which defaults to disabled. This allows for RenderNodes drawn with
`https://developer.android.com/reference/android/graphics/Canvas#drawRenderNode(android.graphics.RenderNode)` to be re-arranged based off of their
`https://developer.android.com/reference/android/graphics/RenderNode#getElevation()` and `https://developer.android.com/reference/android/graphics/RenderNode#getTranslationZ()`
values. It also enables rendering of shadows for RenderNodes with an elevation or
translationZ.

Any draw reordering will not be moved before this call. A typical usage of this might
look something like:

```
     void draw(Canvas canvas) {
         // Draw any background content
         canvas.drawColor(backgroundColor);

         // Begin drawing that may be reordered based off of Z
         canvas.enableZ();
         for (RenderNode child : children) {
             canvas.drawRenderNode(child);
         }
         // End drawing that may be reordered based off of Z
         canvas.disableZ();

         // Draw any overlays
         canvas.drawText("I'm on top of everything!", 0, 0, paint);
     }
 
```

<br />

Note: This is not impacted by any `https://developer.android.com/reference/android/graphics/Canvas#save()` or `https://developer.android.com/reference/android/graphics/Canvas#restore()` calls as it is not considered to be part of the current matrix or clip. See `https://developer.android.com/reference/android/graphics/Canvas#disableZ()`

<br />

<br />

### getHeight

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getHeight ()
```

Returns the height of the current drawing layer

<br />

| Returns ||
|---|---|
| `int` | the height of the current drawing layer <br /> |

### getMaximumBitmapHeight

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaximumBitmapHeight ()
```

Returns the maximum allowed height for bitmaps drawn with this canvas.
Attempting to draw with a bitmap taller than this value will result
in an error.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getMaximumBitmapWidth

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaximumBitmapWidth ()
```

Returns the maximum allowed width for bitmaps drawn with this canvas.
Attempting to draw with a bitmap wider than this value will result
in an error.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getWidth

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWidth ()
```

Returns the width of the current drawing layer

<br />

| Returns ||
|---|---|
| `int` | the width of the current drawing layer <br /> |

### isHardwareAccelerated

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isHardwareAccelerated ()
```

Indicates whether this Canvas uses hardware acceleration.

Note that this method does not define what type of hardware acceleration
may or may not be used.

<br />

| Returns ||
|---|---|
| `boolean` | True if drawing operations are hardware accelerated, false otherwise. <br /> |

### isOpaque

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOpaque ()
```

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

<br />

| Returns ||
|---|---|
| `boolean` | true if the device that the current layer draws into is opaque <br /> |

### setBitmap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setBitmap (Bitmap bitmap)
```

Specify a bitmap for the canvas to draw into. All canvas state such as
layers, filters, and the save/restore stack are reset. Additionally,
the canvas' target density is updated to match that of the bitmap.

Prior to API level `https://developer.android.com/` the current matrix and
clip stack were preserved.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: Specifies a mutable bitmap for the canvas to draw into. This value may be `null`. <br /> |

### setDensity

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDensity (int density)
```

<br />

Specifies the density for this Canvas' backing bitmap. This modifies
the target density of the canvas itself, as well as the density of its
backing bitmap via `https://developer.android.com/reference/android/graphics/Bitmap#setDensity(int)`.

<br />

| Parameters ||
|---|---|
| `density` | `int`: The new target density of the canvas, which is used to determine the scaling factor when drawing a bitmap into it. Use `https://developer.android.com/reference/android/graphics/Bitmap#DENSITY_NONE` to disable bitmap scaling. <br /> |