Android examples for android.graphics:Image Load Save
create Bitmap From Image File
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 ww w.j a v a 2s . c o m try { FileInputStream fis = new FileInputStream(imagefile); bitmap = BitmapFactory.decodeStream(fis); } catch (IOException e) { e.printStackTrace(); if (imagefile.exists()) imagefile.delete(); } return bitmap; } }