public static class

BitmapFactory.Options

extends Object
java.lang.Object
   ↳ android.graphics.BitmapFactory.Options

Summary

Fields
public boolean inDither If dither is true, the decoder will atttempt to dither the decoded image.
public boolean inJustDecodeBounds If set to true, the decoder will return null (no bitmap), but the out...
public Bitmap.Config inPreferredConfig If this is non-null, the decoder will try to decode into this internal configuration.
public int inSampleSize If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory.
public byte[] inTempStorage Temp storage to use for decoding.
public boolean mCancel Flag to indicate that cancel has been called on this object.
public int outHeight The resulting height of the bitmap, set independent of the state of inJustDecodeBounds.
public String outMimeType If known, this string is set to the mimetype of the decoded image.
public int outWidth The resulting width of the bitmap, set independent of the state of inJustDecodeBounds.
Public Constructors
BitmapFactory.Options()
Create a default Options object, which if left unchanged will give the same result from the decoder as if null were passed.
Public Methods
void requestCancelDecode()
This can be called from another thread while this options object is inside a decode...
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public boolean inDither

If dither is true, the decoder will atttempt to dither the decoded image.

public boolean inJustDecodeBounds

If set to true, the decoder will return null (no bitmap), but the out... fields will still be set, allowing the caller to query the bitmap without having to allocate the memory for its pixels.

public Bitmap.Config inPreferredConfig

If this is non-null, the decoder will try to decode into this internal configuration. If it is null, or the request cannot be met, the decoder will try to pick the best matching config based on the system's screen depth, and characteristics of the original image such as if it has per-pixel alpha (requiring a config that also does).

public int inSampleSize

If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory. The sample size is the number of pixels in either dimension that correspond to a single pixel in the decoded bitmap. For example, inSampleSize == 4 returns an image that is 1/4 the width/height of the original, and 1/16 the number of pixels. Any value <= 1 is treated the same as 1. Note: the decoder will try to fulfill this request, but the resulting bitmap may have different dimensions that precisely what has been requested. Also, powers of 2 are often faster/easier for the decoder to honor.

public byte[] inTempStorage

Temp storage to use for decoding. Suggest 16K or so.

public boolean mCancel

Flag to indicate that cancel has been called on this object. This is useful if there's an intermediary that wants to first decode the bounds and then decode the image. In that case the intermediary can check, inbetween the bounds decode and the image decode, to see if the operation is canceled.

public int outHeight

The resulting height of the bitmap, set independent of the state of inJustDecodeBounds. However, if there is an error trying to decode, outHeight will be set to -1.

public String outMimeType

If known, this string is set to the mimetype of the decoded image. If not know, or there is an error, it is set to null.

public int outWidth

The resulting width of the bitmap, set independent of the state of inJustDecodeBounds. However, if there is an error trying to decode, outWidth will be set to -1.

Public Constructors

public BitmapFactory.Options ()

Create a default Options object, which if left unchanged will give the same result from the decoder as if null were passed.

Public Methods

public void requestCancelDecode ()

This can be called from another thread while this options object is inside a decode... call. Calling this will notify the decoder that it should cancel its operation. This is not guaranteed to cancel the decode, but if it does, the decoder... operation will return null, or if inJustDecodeBounds is true, will set outWidth/outHeight to -1