语言

Canvas.SetBitmap(Bitmap) 方法

定义

指定要绘制的画布的位图。

[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

参数

bitmap
Bitmap

指定要绘制到的画布的可变位图。

特性

注解

指定要绘制的画布的位图。 所有画布状态(如层、筛选器和保存/还原堆栈)都会重置。 此外,画布的目标密度会更新为匹配位图的目标密度。

在 API 级别 Build.VERSION_CODES#O 之前,将保留当前矩阵和剪辑堆栈。

Java文档android.graphics.Canvas.setBitmap(android.graphics.Bitmap)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

另请参阅