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 convertByteArrayToBitmap(byte[] bytes) {
    if (bytes != null)
        return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
    return null;//  w  w w. java2s . co m
}

From source file:Main.java

public static Bitmap byteToBitmap(byte[] temp) {
    if (temp != null) {
        Bitmap bitmap = BitmapFactory.decodeByteArray(temp, 0, temp.length);
        return bitmap;
    } else {//from   w  ww .  j a  v  a2  s . c o  m
        return null;
    }
}

From source file:Main.java

public static Bitmap Bytes2Bitmap(byte[] b) {
    if (b != null && b.length != 0) {
        return BitmapFactory.decodeByteArray(b, 0, b.length);
    }/*from   www  .j  a v a  2 s  .co  m*/
    return null;
}

From source file:Main.java

public static Bitmap byteToBitmap(byte[] paramArrayOfByte) {
    try {//  www .j a  v  a2s  . co m
        Bitmap localBitmap = BitmapFactory.decodeByteArray(paramArrayOfByte, 0, paramArrayOfByte.length);
        return localBitmap;
    } catch (Exception localException) {
        localException.printStackTrace();
    }
    return null;
}

From source file:Main.java

public static synchronized Bitmap byteArrayToBitmap(byte[] bytes) {
    if (bytes != null) {
        return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
    } else {// ww w .  ja v  a 2  s .com
        return null;
    }
}

From source file:Main.java

public static Bitmap byteToDrawable(Context context, byte[] bb) {
    Bitmap pp = BitmapFactory.decodeByteArray(bb, 0, bb.length);
    return pp;
}

From source file:Main.java

public static Bitmap takePic(byte[] data, Camera camera) {

    Bitmap res = BitmapFactory.decodeByteArray(data, 0, data.length);
    // ScreenShot.savePic(res,
    // ServerConstant.SHOT_CAM_TEMP_BG_LOC);
    return res;//from   ww  w  .j a v a 2s  . c  om
}

From source file:Main.java

public static Bitmap toBitmap(byte[] data) {
    Bitmap bitmap = null;/*from w w  w. j  av  a2s .c  om*/

    try {
        bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
    } catch (OutOfMemoryError e) {
    }

    return bitmap;
}

From source file:Main.java

public static Bitmap bytes2Bitmap(byte[] b) {
    if (b == null) {
        return null;
    }//from w ww. j a  v a  2 s .  c  o m
    return BitmapFactory.decodeByteArray(b, 0, b.length);
}

From source file:Main.java

private static Bitmap Bytes2Bimap(byte[] b) {
    if (b.length == 0) {
        return null;
    }//from w w w  .jav  a2 s .  c o  m
    return BitmapFactory.decodeByteArray(b, 0, b.length);
}