List of utility methods to do Bitmap to Byte Array Convert
byte[] | getBytes(Bitmap bm) get Bytes ByteArrayOutputStream stream = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, stream); byte[] byteArray = stream.toByteArray(); return byteArray; |
int | getByteCount(Bitmap bitmap, Bitmap.CompressFormat mCompressFormat) get Byte Count int size = 0; ByteArrayOutputStream output = null; try { output = new ByteArrayOutputStream(); bitmap.compress(mCompressFormat, 100, output); byte[] result = output.toByteArray(); size = result.length; result = null; ... |