Dela via


Canvas.SetBitmap(Bitmap) Method

Definition

Specify a bitmap for the canvas to draw into.

[Android.Runtime.Register("setBitmap", "(Landroid/graphics/Bitmap;)V", "GetSetBitmap_Landroid_graphics_Bitmap_Handler")]
public virtual void SetBitmap (Android.Graphics.Bitmap? bitmap);
[<Android.Runtime.Register("setBitmap", "(Landroid/graphics/Bitmap;)V", "GetSetBitmap_Landroid_graphics_Bitmap_Handler")>]
abstract member SetBitmap : Android.Graphics.Bitmap -> unit
override this.SetBitmap : Android.Graphics.Bitmap -> unit

Parameters

bitmap
Bitmap

Specifies a mutable bitmap for the canvas to draw into.

Attributes

Remarks

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 Build.VERSION_CODES#O the current matrix and clip stack were preserved.

Java documentation for android.graphics.Canvas.setBitmap(android.graphics.Bitmap).

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

Applies to

See also