Aracılığıyla paylaş


TextureView.GetBitmap Method

Definition

Overloads

GetBitmap(Bitmap)

Copies the content of this view's surface texture into the specified bitmap.

GetBitmap(Int32, Int32)

Returns a android.graphics.Bitmap representation of the content of the associated surface texture.

GetBitmap(Bitmap)

Copies the content of this view's surface texture into the specified 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

Parameters

bitmap
Bitmap

The bitmap to copy the content of the surface texture into, cannot be null, all configurations are supported

Returns

The bitmap specified as a parameter

Attributes

Exceptions

if the hardware rendering context cannot be acquired to capture the bitmap

Remarks

Copies the content of this view's surface texture into the specified bitmap. If the surface texture is not available, the copy is not executed. The content of the surface texture will be scaled to fit exactly inside the specified bitmap.

<strong>Do not</strong> invoke this method from a drawing method (#onDraw(android.graphics.Canvas) for instance).

If an error occurs, the bitmap is left unchanged.

Java documentation for android.view.TextureView.getBitmap(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.

See also

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

Applies to

GetBitmap(Int32, Int32)

Returns a android.graphics.Bitmap representation of the content of the associated surface texture.

[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

Parameters

width
Int32

The width of the bitmap to create

height
Int32

The height of the bitmap to create

Returns

A valid Bitmap.Config#ARGB_8888 bitmap, or null if the surface texture is not available or width is &lt;= 0 or height is &lt;= 0

Attributes

Remarks

Returns a android.graphics.Bitmap representation of the content of the associated surface texture. If the surface texture is not available, this method returns null.

The bitmap returned by this method uses the Bitmap.Config#ARGB_8888 pixel format.

<strong>Do not</strong> invoke this method from a drawing method (#onDraw(android.graphics.Canvas) for instance).

If an error occurs during the copy, an empty bitmap will be returned.

Java documentation for android.view.TextureView.getBitmap(int, int).

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.

See also

Applies to