Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. fun storeBitmapInFile(bitmap: Bitmap, file: File) {
  2.  
  3. try {
  4. val fOut = FileOutputStream(file)
  5. bitmap.compress(Bitmap.CompressFormat.JPEG, 95, fOut)
  6. fOut.flush()
  7. fOut.close()
  8. } catch (e: Exception) {
  9. e.printStackTrace()
  10. }
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement