Android Guides | Samples

Android.Media.ImageReader Class

See Also: ImageReader


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


The ImageReader class allows direct application access to image data rendered into a Surface

Several Android media API classes accept Surface objects as targets to render to, including MediaPlayer, MediaCodec, CameraDevice, ImageWriter and Allocation. The image sizes and formats that can be used with each source vary, and should be checked in the documentation for the specific API.

The image data is encapsulated in Image objects, and multiple such objects can be accessed at the same time, up to the number specified by the maxImages constructor parameter. New images sent to an ImageReader through its Surface are queued until accessed through the ImageReader.AcquireLatestImage or ImageReader.AcquireNextImage call. Due to memory limits, an image source will eventually stall or drop Images in trying to render to the Surface if the ImageReader does not obtain and release Images at a rate equal to the production rate.

[Android Documentation]


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

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

See Also: Object

Protected Constructors

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

Public Properties

HeightInt32. The default height of Image, in pixels.
ImageFormatImageFormatType. The default ImageFormat of Image.
MaxImagesInt32. Maximum number of images that can be acquired from the ImageReader by any time (for example, with ImageReader.AcquireNextImage).
WidthInt32. The default width of Image, in pixels.

Protected Properties

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

Public Methods

AcquireLatestImage() : Image
AcquireNextImage() : Image
Free up all the resources associated with this ImageReader.
NewInstance(Int32, Int32, ImageFormatType, Int32) : ImageReader
SetOnImageAvailableListener(ImageReader+IOnImageAvailableListener, Handler)
Register a listener to be invoked when a new image becomes available from the ImageReader.