Android Guides | Samples

Android.Media.ImageReader Class

See Also: ImageReader

Syntax

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

Remarks

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]

Requirements

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

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

[read-only]
HeightInt32. The default height of Image, in pixels.
[read-only]
ImageFormatImageFormatType. The default ImageFormat of Image.
[read-only]
MaxImagesInt32. Maximum number of images that can be acquired from the ImageReader by any time (for example, with ImageReader.AcquireNextImage).
[read-only]
SurfaceSurface.
[read-only]
WidthInt32. The default width of 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

AcquireLatestImage() : Image
AcquireNextImage() : Image
Close()
Free up all the resources associated with this ImageReader.
static
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.