Android examples for android.graphics:Bitmap Load Save
read BitMap from file
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap readBitMap(File file) throws FileNotFoundException { BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inPreferredConfig = Bitmap.Config.RGB_565; opt.inPurgeable = true;//from www . jav a 2 s.c o m opt.inInputShareable = true; InputStream is = new FileInputStream(file); return BitmapFactory.decodeStream(is, null, opt); } }