Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void bitmap2jpg(Activity activity,Bitmap bitName,String filename) throws IOException {
- FileOutputStream fos = activity.openFileOutput(filename +".jpeg",Context.MODE_PRIVATE);
- bitName.compress(Bitmap.CompressFormat.PNG, 100, fos);
- try {
- fos.flush();
- } catch (IOException e) {
- e.printStackTrace();
- }
- try {
- fos.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment