Android Guides | Samples

Android.Media.Image Class

See Also: Image

Syntax

[Android.Runtime.Register("android/media/Image", DoNotGenerateAcw=true)]
public abstract class Image : Object

Remarks

A single complete image buffer to use with a media source such as a MediaCodec or a CameraDevice.

This class allows for efficient direct application access to the pixel data of the Image through one or more ByteBuffer. Each buffer is encapsulated in a NoType:android/media/Image$Plane;Href=../../../reference/android/media/Image.Plane.html that describes the layout of the pixel data in that plane. Due to this direct access, and unlike the Bitmap class, Images are not directly usable as as UI resources.

Since Images are often directly produced or consumed by hardware components, they are a limited resource shared across the system, and should be closed as soon as they are no longer needed.

For example, when using the ImageReader class to read out Images from various media sources, not closing old Image objects will prevent the availability of new Images once ImageReader.MaxImages is reached. When this happens, the function acquiring new Images will typically throw an IllegalStateException.

See Also

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.Media.Image are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

CropRectRect. Get the crop rectangle associated with this frame.
[read-only]
abstract
FormatImageFormatType. Get the format for this image.
[read-only]
abstract
HeightInt32. The height of the image in pixels.
[read-only]
abstract
TimestampInt64. Get the timestamp associated with this frame.
[read-only]
abstract
WidthInt32. The width of the image in pixels.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

abstract
Close()
Free up this frame for reuse.
abstract
GetPlanes() : Image+Plane[]
Get the array of pixel planes for this Image.