Android Bitmap Load decodeF(File f)

Here you can find the source of decodeF(File f)

Description

Decode f.

Parameter

Parameter Description
f the f

Return

the bitmap

Declaration

private static Bitmap decodeF(File f) 

Method Source Code

//package com.java2s;

import java.io.File;
import java.io.FileInputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {
    /**//w ww  .jav  a 2s. c  o  m
     * Decode f.
     *
     * @param f the f
     * @return the bitmap
     */
    private static Bitmap decodeF(File f) {
        Bitmap b = null;
        try {

            BitmapFactory.Options bfo = new BitmapFactory.Options();
            FileInputStream fis = new FileInputStream(f);
            b = BitmapFactory.decodeStream(fis, null, bfo);
            fis.close();

        } catch (Exception e) {

            e.printStackTrace();

        }
        return b;

    }
}

Related

  1. loadBitmapFromStorage(String path)
  2. loadImage(String filename)
  3. loadImage(String urlStr)
  4. loadPreviewBitmap(String fileName, int width, int height)
  5. SafeDecodeBitmapFile( String strFilePath)
  6. decodeFile(File f, int size)
  7. decodeFromDescriptor( FileDescriptor descriptor)
  8. decodeFromDescriptor( FileDescriptor descriptor, int reqWidth, int reqHeight)
  9. getBitmap(Context c, String uri, int minsizeDP)