Skip to content

Instantly share code, notes, and snippets.

@shihabmi7
Created May 29, 2016 08:06
Show Gist options
  • Save shihabmi7/e638d5cf35284d02ce92406aeb22e1dc to your computer and use it in GitHub Desktop.
Save shihabmi7/e638d5cf35284d02ce92406aeb22e1dc to your computer and use it in GitHub Desktop.
byte[] convertBitMapToByteArray(Bitmap bmp) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
return byteArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment