Android Guides | Samples

Android.Graphics.BitmapRegionDecoder Class

BitmapRegionDecoder can be used to decode a rectangle region from an image.

See Also: BitmapRegionDecoder

Syntax

[Android.Runtime.Register("android/graphics/BitmapRegionDecoder", DoNotGenerateAcw=true)]
public sealed class BitmapRegionDecoder : Object

Remarks

BitmapRegionDecoder can be used to decode a rectangle region from an image. BitmapRegionDecoder is particularly useful when an original image is large and you only need parts of the image.

To create a BitmapRegionDecoder, call newInstance(...). Given a BitmapRegionDecoder, users can call decodeRegion() repeatedly to get a decoded Bitmap of the specified region.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 10

The members of Android.Graphics.BitmapRegionDecoder are listed below.

See Also: Object

Public Properties

[read-only]
HeightInt32. Returns the original image's height
[read-only]
IsRecycledBoolean. Returns true if this region decoder has been recycled.
[read-only]
WidthInt32. Returns the original image's width

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

DecodeRegion(Rect, BitmapFactory+Options) : Bitmap
Decodes a rectangle region in the image specified by rect.
static
NewInstance(FileDescriptor, Boolean) : BitmapRegionDecoder
Create a BitmapRegionDecoder from the file descriptor.
static
NewInstance(Stream, Boolean) : BitmapRegionDecoder
Create a BitmapRegionDecoder from an input stream.
static
NewInstance(String, Boolean) : BitmapRegionDecoder
Create a BitmapRegionDecoder from a file path.
static
NewInstance(Byte[], Int32, Int32, Boolean) : BitmapRegionDecoder
Create a BitmapRegionDecoder from the specified byte array.
Recycle()
Frees up the memory associated with this region decoder, and mark the region decoder as "dead", meaning it will throw an exception if decodeRegion(), getWidth() or getHeight() is called.