Guest User

Untitled

a guest
Aug 6th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public static void bitmap2jpg(Activity activity,Bitmap bitName,String filename) throws IOException {
  2.  
  3. FileOutputStream fos = activity.openFileOutput(filename +".jpeg",Context.MODE_PRIVATE);
  4.  
  5. bitName.compress(Bitmap.CompressFormat.PNG, 100, fos);
  6.  
  7. try {
  8. fos.flush();
  9. } catch (IOException e) {
  10. e.printStackTrace();
  11. }
  12.  
  13.  
  14. try {
  15. fos.close();
  16. } catch (IOException e) {
  17. e.printStackTrace();
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment