Created
July 3, 2018 12:32
-
-
Save kantapp/c6b9bf0b66c889040a9f0db380e7b555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String bitmap2base64(Bitmap bitmap) | |
{ | |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); | |
byte[] byteArray = byteArrayOutputStream .toByteArray(); | |
return Base64.encodeToString(byteArray, Base64.DEFAULT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment