Android Utililty Methods Bitmap from Byte Array Create

List of utility methods to do Bitmap from Byte Array Create

Description

The list of methods to do Bitmap from Byte Array Create are organized into topic(s).

Method

BitmapbyteArrayToBitmap(byte[] b)
byte Array To Bitmap
return BitmapFactory.decodeByteArray(b, 0, b.length);
Bitmapbytes2Bitmap(byte[] b)
bytes Bitmap
if (b.length != 0) {
    return BitmapFactory.decodeByteArray(b, 0, b.length);
} else {
    return null;
BitmapcreateBinaryImage(int[][] source, int width, int height)
create Binary Image
Bitmap bm = Bitmap.createBitmap(width, height,
        Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bm);
int vlen = source.length;
int hlen = source[0].length;
int rectWidth = width / hlen;
int rectHeight = height / hlen;
Rect r = new Rect(0, 0, rectWidth, rectHeight);
...
BitmapcreateBitmapFromByteArray(byte[] data)
create Bitmap From Byte Array
return BitmapFactory.decodeByteArray(data, 0, data.length);
BitmapmakeBitmap(byte[] jpegData, int maxNumOfPixels)
make Bitmap
try {
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inJustDecodeBounds = true;
    BitmapFactory.decodeByteArray(jpegData, 0, jpegData.length,
            options);
    if (options.mCancel || options.outWidth == -1
            || options.outHeight == -1) {
        return null;
...
BitmapunFlattenBitmap(byte[] bitmapData)
un Flatten Bitmap
Bitmap bitmap = null;
if (bitmapData != null && bitmapData.length > 0) {
    bitmap = BitmapFactory.decodeByteArray(bitmapData, 0,
            bitmapData.length);
return bitmap;
BitmapgetBitmapImage(Context context, String base64)
Gets the bitmap image.
String imagestring = base64;
byte[] imageAsBytes = Base64.decode(imagestring.getBytes(), 5);
return BitmapFactory.decodeByteArray(imageAsBytes, 0,
        imageAsBytes.length);
BitmapBytes2Bimap(byte[] b)
Bytes Bimap
if (b.length != 0) {
    return BitmapFactory.decodeByteArray(b, 0, b.length);
} else {
    return null;
Bitmapbytes2Bimap(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;
BitmapconvertByteArrayToBitmap(byte[] b)
convert Byte Array To Bitmap
if (b == null) {
    return null;
ByteArrayInputStream imageStream = new ByteArrayInputStream(b);
Bitmap theImage = BitmapFactory.decodeStream(imageStream);
return theImage;