Build 1.0_r1(from source)

android.graphics
Class BitmapFactory.Options

java.lang.Object
  extended by android.graphics.BitmapFactory.Options
Enclosing class:
BitmapFactory

public static class BitmapFactory.Options
extends Object


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

Field Detail

inJustDecodeBounds

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.


inSampleSize

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.="">


inPreferredConfig

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).


inDither

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


outWidth

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.


outHeight

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.


outMimeType

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.


inTempStorage

public byte[] inTempStorage
Temp storage to use for decoding. Suggest 16K or so.


mCancel

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.

Constructor Detail

BitmapFactory.Options

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.

Method Detail

requestCancelDecode

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


Build 1.0_r1(from source)

Please submit a feedback, bug or feature