語言

TextureView.GetBitmap 方法

定義

多載

名稱 Description
GetBitmap(Bitmap)

將此視圖表面貼圖的內容複製到指定的位圖中。

GetBitmap(Int32, Int32)

回傳 android.graphics.Bitmap 相關表面貼圖內容的表示。

GetBitmap(Bitmap)

將此視圖表面貼圖的內容複製到指定的位圖中。

[Android.Runtime.Register("getBitmap", "(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;", "GetGetBitmap_Landroid_graphics_Bitmap_Handler")]
public virtual Android.Graphics.Bitmap GetBitmap(Android.Graphics.Bitmap bitmap);
[<Android.Runtime.Register("getBitmap", "(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;", "GetGetBitmap_Landroid_graphics_Bitmap_Handler")>]
abstract member GetBitmap : Android.Graphics.Bitmap -> Android.Graphics.Bitmap
override this.GetBitmap : Android.Graphics.Bitmap -> Android.Graphics.Bitmap

參數

bitmap
Bitmap

將表面紋理內容複製的位圖不能為空,所有配置皆支援

傳回

參數指定為點陣圖

屬性

例外狀況

若無法取得硬體渲染上下文以擷取點陣圖

備註

將此視圖表面貼圖的內容複製到指定的位圖中。 若無法取得表面貼圖,則不會執行該複製。 表面貼圖的內容會被縮放,以完全符合指定的位圖範圍。

<強>不要/強> 將此方法從繪圖方法#onDraw(android.graphics.Canvas)(例如)<中調用。

若發生錯誤,位圖保持不變。

Java 文件 android.view.TextureView.getBitmap(android.graphics.Bitmap)。

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

另請參閱

  • IsAvailable
  • <xref:Android.Views.TextureView.GetBitmap(System.Int32%2c+System.Int32)>
  • Bitmap

適用於

GetBitmap(Int32, Int32)

回傳 android.graphics.Bitmap 相關表面貼圖內容的表示。

[Android.Runtime.Register("getBitmap", "(II)Landroid/graphics/Bitmap;", "GetGetBitmap_IIHandler")]
public virtual Android.Graphics.Bitmap? GetBitmap(int width, int height);
[<Android.Runtime.Register("getBitmap", "(II)Landroid/graphics/Bitmap;", "GetGetBitmap_IIHandler")>]
abstract member GetBitmap : int * int -> Android.Graphics.Bitmap
override this.GetBitmap : int * int -> Android.Graphics.Bitmap

參數

width
Int32

要建立的位圖寬度

height
Int32

要建立的位圖高度

傳回

有效的 位圖,或若無法取得表面紋理,或寬度為 <= 0,或高度為 <= 0,則為 null

屬性

備註

回傳 android.graphics.Bitmap 相關表面貼圖內容的表示。 若無法取得表面貼圖,則此方法回傳 null。

此方法回傳的位圖使用像素 Bitmap.Config#ARGB_8888 格式。

<強>不要/強> 將此方法從繪圖方法#onDraw(android.graphics.Canvas)(例如)<中調用。

若複製過程中發生錯誤,則會回傳一個空的位圖。

Java 文件 android.view.TextureView.getBitmap(int, int)。

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

另請參閱

適用於