Example usage for android.graphics BitmapFactory decodeByteArray

List of usage examples for android.graphics BitmapFactory decodeByteArray

Introduction

In this page you can find the example usage for android.graphics BitmapFactory decodeByteArray.

Prototype

public static Bitmap decodeByteArray(byte[] data, int offset, int length) 

Source Link

Document

Decode an immutable bitmap from the specified byte array.

Usage

From source file:Main.java

public static Bitmap base64ToBitmap(String base64Data) {
    byte[] bytes = Base64.decode(base64Data, Base64.DEFAULT);
    return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
}

From source file:Main.java

public static Bitmap base64ToBitmap(String b64) {
    byte[] imageAsBytes = Base64.decode(b64.getBytes(), Base64.DEFAULT);
    return BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length);
}

From source file:Main.java

public static Bitmap getImageAsBitmap(String image) {
    byte[] imageAsBytes = Base64.decode(image, Base64.DEFAULT);
    Bitmap bmp = BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length);
    return bmp;/*from   w w  w  .  j a  v  a2 s .co m*/
}

From source file:Main.java

public static Bitmap Bytes2Bimap(byte[] b) {
    if (b.length == 0) {
        return null;
    }//from   w ww.j  a  va 2s .com
    return BitmapFactory.decodeByteArray(b, 0, b.length);
}

From source file:Main.java

public static Bitmap unFlattenBitmap(byte[] bitmapData) {
    Bitmap bitmap = null;/* ww w  .  j a v  a  2  s  .c  om*/
    if (bitmapData != null && bitmapData.length > 0) {
        bitmap = BitmapFactory.decodeByteArray(bitmapData, 0, bitmapData.length);
    }
    return bitmap;
}

From source file:Main.java

public static Bitmap bitmapFromBytes(byte[] b) {
    if (b == null) {
        return null;
    }/*w ww  . ja  va2s  .  c om*/
    return BitmapFactory.decodeByteArray(b, 0, b.length);
}

From source file:Main.java

public static Bitmap base64ToBitmap(String base64String) {
    byte[] imgBytes = Base64.decode(base64String, Base64.DEFAULT);

    return BitmapFactory.decodeByteArray(imgBytes, 0, imgBytes.length);
}

From source file:Main.java

public static Bitmap byte2Bitmap(byte[] data) {
    if (data == null) {
        return null;
    }//from  w  ww .j ava2  s  .co m
    return BitmapFactory.decodeByteArray(data, 0, data.length);
}

From source file:Main.java

public static Bitmap bytes2Bitmap(byte[] data) {
    if (data == null) {
        return null;
    }//w ww  .  j a  v  a2 s .  co m
    return BitmapFactory.decodeByteArray(data, 0, data.length);
}

From source file:Main.java

public static Bitmap decodeBitmap(String imageString) {
    byte[] imageBytes = Base64.decode(imageString, Base64.DEFAULT);
    Bitmap bmp = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);

    return bmp;/* w w w .  j  a v  a  2  s  .  c o  m*/
}