Created
September 27, 2019 22:56
-
-
Save parzibyte/353b7f0a6b60a52472e9f5086b0be886 to your computer and use it in GitHub Desktop.
This file contains 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
Bitmap bitmap = ((BitmapDrawable) imageViewMuestra.getDrawable()).getBitmap(); | |
if (bitmap != null) { | |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); | |
byte[] byteArray = byteArrayOutputStream.toByteArray(); | |
String fotoEnBase64 = Base64.encodeToString(byteArray, Base64.DEFAULT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment