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 decodeBase64Image(String encodedImage) {
    byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT);
    return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
}

From source file:Main.java

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

From source file:Main.java

public static Bitmap getBitmapFromBase64(String base64) {
    byte[] decodedString = Base64.decode(base64, Base64.DEFAULT);
    Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
    return decodedByte;
}

From source file:Main.java

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

From source file:Main.java

/**
 * convert from byte array to bitmap//www  .  jav a 2  s .  com
 */
public static Bitmap getImage(byte[] image) {
    if (image == null) {
        return null;
    }
    return BitmapFactory.decodeByteArray(image, 0, image.length);
}

From source file:Main.java

public static Bitmap getBitmap(byte[] byteArray) {
    return byteArray == null ? null : BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
}

From source file:Main.java

public static Bitmap decodeBase64(String input) {
    try {//from  w  w w. j a  v  a 2 s.c o  m
        byte[] decodedBytes = Base64.decode(input, Base64.DEFAULT);
        return BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length);
    } catch (IllegalArgumentException e) {
        return null;
    }
}

From source file:Main.java

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

From source file:Main.java

public static Bitmap convertBase64IntoBitmap(String base64) {
    byte[] decodedString = convertBase64IntoByte(base64);
    Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
    return decodedByte;
}

From source file:Main.java

public static Bitmap getimg(String str) {
    byte[] bytes;
    bytes = Base64.decode(str, 0);/*from   www .  j  a va 2 s.  co  m*/
    return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
}