Here you can find the source of createBitmapFromImageFile(File imagefile)
public static Bitmap createBitmapFromImageFile(File imagefile)
//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; } }