語言

Canvas.DrawBitmap 方法

定義

多載

名稱 Description
DrawBitmap(Int32[], Int32, Int32, Single, Single, Int32, Int32, Boolean, Paint)
已淘汰.

將指定的顏色陣列視為點陣圖,並繪製它。

DrawBitmap(Int32[], Int32, Int32, Int32, Int32, Int32, Int32, Boolean, Paint)
已淘汰.

drawBitmap(int[] colors, .

DrawBitmap(Bitmap, Single, Single, Paint)

繪製指定的位圖,其左上角位於 (x,y),使用指定的塗料,並由當前矩陣轉換。

DrawBitmap(Bitmap, Matrix, Paint)

使用指定的矩陣繪製位圖。

DrawBitmap(Bitmap, Rect, Rect, Paint)

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。

DrawBitmap(Bitmap, Rect, RectF, Paint)

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。

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

警告

deprecated

將指定的顏色陣列視為點陣圖,並繪製它。

[Android.Runtime.Register("drawBitmap", "([IIIFFIIZLandroid/graphics/Paint;)V", "GetDrawBitmap_arrayIIIFFIIZLandroid_graphics_Paint_Handler")]
[System.Obsolete("deprecated")]
public virtual void DrawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, bool hasAlpha, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "([IIIFFIIZLandroid/graphics/Paint;)V", "GetDrawBitmap_arrayIIIFFIIZLandroid_graphics_Paint_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member DrawBitmap : int[] * int * int * single * single * int * int * bool * Android.Graphics.Paint -> unit
override this.DrawBitmap : int[] * int * int * single * single * int * int * bool * Android.Graphics.Paint -> unit

參數

colors
Int32[]

代表點陣圖像素的顏色陣列

offset
Int32

偏移到第一個像素的顏色陣列中

stride
Int32

陣列中列間的顏色數量(必須是 >= 寬度或 <= -width)。

x
Single

X 座標用於繪製點陣圖的位置

y
Single

繪製點陣圖的 Y 座標

width
Int32

點陣圖的寬度

height
Int32

點陣圖的高度

hasAlpha
Boolean

若顏色的 alpha 通道包含有效值,則為真。 若為假,則忽略該 alpha 位元組(假設每個像素皆為 0xFF)。

paint
Paint

可能是 Null。 用來繪製點陣圖的塗料

屬性

備註

將指定的顏色陣列視為點陣圖,並繪製它。 這與先從陣列建立點陣圖再繪製點陣圖的結果相同,但此方法避免明確建立點陣圖物件,若顏色頻繁變動,會更有效率。

此會員已被棄用。 #isHardwareAccelerated() hardware accelerated在畫布中使用時,每次呼叫此方法時都需要一份內部的色彩緩衝區內容副本。 使用位圖可避免此複製,並允許應用程式更明確地控制像素資料的壽命與複製數量。

Java 文件 android.graphics.Canvas.drawBitmap(int[], int, int, float, float, int, int, boolean, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

DrawBitmap(Int32[], Int32, Int32, Int32, Int32, Int32, Int32, Boolean, Paint)

警告

deprecated

drawBitmap(int[] colors, .

[Android.Runtime.Register("drawBitmap", "([IIIIIIIZLandroid/graphics/Paint;)V", "GetDrawBitmap_arrayIIIIIIIZLandroid_graphics_Paint_Handler")]
[System.Obsolete("deprecated")]
public virtual void DrawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, bool hasAlpha, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "([IIIIIIIZLandroid/graphics/Paint;)V", "GetDrawBitmap_arrayIIIIIIIZLandroid_graphics_Paint_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member DrawBitmap : int[] * int * int * int * int * int * int * bool * Android.Graphics.Paint -> unit
override this.DrawBitmap : int[] * int * int * int * int * int * int * bool * Android.Graphics.Paint -> unit

參數

colors
Int32[]
offset
Int32
stride
Int32
x
Int32
y
Int32
width
Int32
height
Int32
hasAlpha
Boolean
paint
Paint

繪製點陣圖所用的塗料(可能是 null)

屬性

備註

舊版的 drawBitmap(int[] 顏色,...) 對 x,y 的整數

此會員已被棄用。 #isHardwareAccelerated() hardware accelerated在畫布中使用時,每次呼叫此方法時都需要一份內部的色彩緩衝區內容副本。 使用位圖可避免此複製,並允許應用程式更明確地控制像素資料的壽命與複製數量。

Java 文件 android.graphics.Canvas.drawBitmap(int[], int, int, int, int, int, int, boolean, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

DrawBitmap(Bitmap, Single, Single, Paint)

繪製指定的位圖,其左上角位於 (x,y),使用指定的塗料,並由當前矩陣轉換。

[Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_FFLandroid_graphics_Paint_Handler")]
public virtual void DrawBitmap(Android.Graphics.Bitmap bitmap, float left, float top, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_FFLandroid_graphics_Paint_Handler")>]
abstract member DrawBitmap : Android.Graphics.Bitmap * single * single * Android.Graphics.Paint -> unit
override this.DrawBitmap : Android.Graphics.Bitmap * single * single * Android.Graphics.Paint -> unit

參數

bitmap
Bitmap

要繪製的點陣圖

left
Single

繪製點陣左側的位置

top
Single

正在繪製的位圖上方的位置

paint
Paint

繪製點陣圖所用的塗料(可能是 null)

屬性

備註

繪製指定的位圖,其左上角位於 (x,y),使用指定的塗料,並由當前矩陣轉換。

注意:如果 Paint 包含一個遮罩濾鏡,產生的遮罩範圍超出點陣原本的寬度/高度(例如 BlurMaskFilter),那麼該點陣圖會以帶有 CLAMP 模式的著色器繪製方式繪製。 因此,原本寬度/高度之外的顏色就是被複製的邊緣顏色。

如果點陣圖和畫布密度不同,這個功能會自動調整點陣圖,使其繪製密度與畫布相同。

Java 文件 android.graphics.Canvas.drawBitmap(android.graphics.Bitmap, float, float, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

DrawBitmap(Bitmap, Matrix, Paint)

使用指定的矩陣繪製位圖。

[Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Matrix_Landroid_graphics_Paint_Handler")]
public virtual void DrawBitmap(Android.Graphics.Bitmap bitmap, Android.Graphics.Matrix matrix, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Matrix_Landroid_graphics_Paint_Handler")>]
abstract member DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Matrix * Android.Graphics.Paint -> unit
override this.DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Matrix * Android.Graphics.Paint -> unit

參數

bitmap
Bitmap

要繪製的點陣圖

matrix
Matrix

繪製點陣時用來轉換點陣

paint
Paint

可能是 Null。 用來繪製點陣圖的塗料

屬性

備註

使用指定的矩陣繪製位圖。

Java 文件 android.graphics.Canvas.drawBitmap(android.graphics.Bitmap, android.graphics.Matrix, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

DrawBitmap(Bitmap, Rect, Rect, Paint)

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。

[Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Rect_Landroid_graphics_Rect_Landroid_graphics_Paint_Handler")]
public virtual void DrawBitmap(Android.Graphics.Bitmap bitmap, Android.Graphics.Rect? src, Android.Graphics.Rect dst, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Rect_Landroid_graphics_Rect_Landroid_graphics_Paint_Handler")>]
abstract member DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.Rect * Android.Graphics.Paint -> unit
override this.DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.Rect * Android.Graphics.Paint -> unit

參數

bitmap
Bitmap

要繪製的點陣圖

src
Rect

可能是 Null。 要繪製的位圖子集

dst
Rect

位圖要縮放/平移以容納的矩形

paint
Paint

可能是 Null。 用來繪製點陣圖的塗料

屬性

備註

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。 如果來源矩形不是 null,則指定要繪製的點陣子集。

注意:如果 Paint 包含一個遮罩濾鏡,產生的遮罩範圍超出點陣原本的寬度/高度(例如 BlurMaskFilter),那麼該點陣圖會以帶有 CLAMP 模式的著色器繪製方式繪製。 因此,原本寬度/高度之外的顏色就是被複製的邊緣顏色。

這個函數 <em>忽略了與位圖</em> 相關的密度。 這是因為來源與目標矩形座標空間各自處於密度,必須已套用適當的縮放因子。

Java 文件 android.graphics.Canvas.drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.Rect, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

DrawBitmap(Bitmap, Rect, RectF, Paint)

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。

[Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/RectF;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Rect_Landroid_graphics_RectF_Landroid_graphics_Paint_Handler")]
public virtual void DrawBitmap(Android.Graphics.Bitmap bitmap, Android.Graphics.Rect? src, Android.Graphics.RectF dst, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmap", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/RectF;Landroid/graphics/Paint;)V", "GetDrawBitmap_Landroid_graphics_Bitmap_Landroid_graphics_Rect_Landroid_graphics_RectF_Landroid_graphics_Paint_Handler")>]
abstract member DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.RectF * Android.Graphics.Paint -> unit
override this.DrawBitmap : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.RectF * Android.Graphics.Paint -> unit

參數

bitmap
Bitmap

要繪製的點陣圖

src
Rect

可能是 Null。 要繪製的位圖子集

dst
RectF

位圖要縮放/平移以容納的矩形

paint
Paint

可能是 Null。 用來繪製點陣圖的塗料

屬性

備註

繪製指定的點陣圖,並自動縮放/平移填滿目標矩形。 如果來源矩形不是 null,則指定要繪製的點陣子集。

注意:如果 Paint 包含一個遮罩濾鏡,產生的遮罩範圍超出點陣原本的寬度/高度(例如 BlurMaskFilter),那麼該點陣圖會以帶有 CLAMP 模式的著色器繪製方式繪製。 因此,原本寬度/高度之外的顏色就是被複製的邊緣顏色。

這個函數 <em>忽略了與位圖</em> 相關的密度。 這是因為來源與目標矩形座標空間各自處於密度,必須已套用適當的縮放因子。

Java 文件 android.graphics.Canvas.drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.RectF, android.graphics.Paint)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於