Code example for BitmapFactory.Options

Methods: decodeFileDescriptor

                BitmapFactory.decodeByteArray(data, 0, data.length, options));
    public static Bitmap requestDecode(JobContext jc,
            FileDescriptor fileDescriptor, Rect paddings, Options options) {
        if (options == null) options = new Options();
        jc.setCancelListener(new DecodeCanceller(options));
        return ensureGLCompatibleBitmap(BitmapFactory.decodeFileDescriptor
                (fileDescriptor, paddings, options));
    // TODO: This function should not be called directly from 
    // DecodeUtils.requestDecode(...), since we don't have the knowledge 
    // if the bitmap will be uploaded to GL. 
    public static Bitmap ensureGLCompatibleBitmap(Bitmap bitmap) {
        if (bitmap == null || bitmap.getConfig() != null) return bitmap;
        Bitmap newBitmap = bitmap.copy(Config.ARGB_8888, false);
        return newBitmap;