List of utility methods to do Byte Array to Bitmap Convert
Bitmap | byteToBitmap(byte[] iconByte) byte To Bitmap return BitmapFactory.decodeByteArray(iconByte, 0, iconByte.length);
|
Bitmap | ByteStringToBitmap(ByteString bytes) Byte String To Bitmap Bitmap bitmap; ByteArrayInputStream inputStream = new ByteArrayInputStream( bytes.toByteArray()); bitmap = BitmapFactory.decodeStream(inputStream).copy( Bitmap.Config.ARGB_8888, true); inputStream.close(); return bitmap; |
Bitmap | decodeSampledBitmapFromData(byte[] data) decode Sampled Bitmap From Data final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeByteArray(data, 0, data.length, options); options.inSampleSize = 1; options.inJustDecodeBounds = false; return BitmapFactory.decodeByteArray(data, 0, data.length, options); |
Bitmap | bytes2Bimap(byte[] b) bytes Bimap Bitmap bitmap = null; try { if (b.length != 0) { bitmap = BitmapFactory.decodeByteArray(b, 0, b.length); } catch (Exception e) { e.printStackTrace(); return bitmap; |
Bitmap | bytes2Bimap(byte[] bytes) bytes Bimap if (bytes.length != 0) { return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); } else { return null; |