Image Class

Definition

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

[Android.Runtime.Register("android/media/Image", DoNotGenerateAcw=true)]
public abstract class Image : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IAutoCloseable
[<Android.Runtime.Register("android/media/Image", DoNotGenerateAcw=true)>]
type Image = class
    inherit Object
    interface IAutoCloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Image
Attributes
Implements

Remarks

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

This class allows for efficient direct application access to the pixel data of the Image through one or more java.nio.ByteBuffer ByteBuffers. Each buffer is encapsulated in a Plane that describes the layout of the pixel data in that plane. Due to this direct access, and unlike the android.graphics.Bitmap Bitmap class, Images are not directly usable 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#getMaxImages the maximum outstanding image count is reached. When this happens, the function acquiring new Images will typically throw an IllegalStateException.

Java documentation for android.media.Image.

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.

Constructors

Image(IntPtr, JniHandleOwnership)

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

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
CropRect

Get the crop rectangle associated with this frame. -or- Set the crop rectangle associated with this frame.

DataSpace

Get the dataspace associated with this frame. -or- Set the dataspace associated with this frame.

Fence

Get the SyncFence object associated with this frame. -or- Set the fence file descriptor with this frame.

Format

Get the format for this image.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HardwareBuffer

Get the android.hardware.HardwareBuffer HardwareBuffer handle of the input image intended for GPU and/or hardware access.

Height

The height of the image in pixels.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Timestamp

Get the timestamp associated with this frame.

Width

The width of the image in pixels.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Free up this frame for reuse.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPlanes()

Get the array of pixel planes for this Image.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to