Android Bitmap Load createBitmapFromImageFile(File imagefile)

Here you can find the source of createBitmapFromImageFile(File imagefile)

Description

create Bitmap From Image File

Declaration

public static Bitmap createBitmapFromImageFile(File imagefile) 

Method Source Code

//package com.java2s;
import java.io.File;
import java.io.FileInputStream;

import java.io.IOException;

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

public class Main {
    public static Bitmap createBitmapFromImageFile(File imagefile) {
        Bitmap bitmap = null;//from w  ww. j ava 2s.  co  m
        try {
            FileInputStream fis = new FileInputStream(imagefile);
            bitmap = BitmapFactory.decodeStream(fis);
        } catch (IOException e) {
            e.printStackTrace();
            if (imagefile.exists())
                imagefile.delete();
        }
        return bitmap;
    }
}

Related

  1. loadBitmapFromFile(String fileNameWithPath)
  2. downloadBitmap(URI uri)
  3. returnBitMap(String path)
  4. getBitmapStoragePath(Context context)
  5. getTempBitmap(Context context)