Tuesday, 17 June 2014

how to convert the bitmap from the file url

public static Bitmap decodeBitmap(File file) {
Bitmap bitmap = null;
// FileInputStream stream1;
try {
BitmapFactory.Options o = new BitmapFactory.Options();
o.inScaled = true;
// stream1 = new FileInputStream(file);
bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), o);
// stream1.close();
} catch (Exception e) {
e.printStackTrace();
}

return bitmap;
}

No comments:

Post a Comment