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.
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.
Free the native object associated with this bitmap, and clear the reference to the pixel data.
這個相當的重要。如果你所處理的圖像很多,記得把已經需要用到的 Bitmap 物件 recycle ,以釋放記憶體。
實際用法如下
public class CameraRunActivity extends Activity implements Callback, OnClickListener {
private static final String TAG = CameraRunActivity.class.getSimpleName();