How to get a BitMap from bye[]
Please Login to Remove!
Hi,
I have a String data value (not a resource location) which I had to ultimately use to display an image.I converted this String to a byte[] using the following code :
byteStream = (a.getUserImage()).getBytes();
Used this byte[] further in the function loadBitmap as :
public static Bitmap loadBitmap(byte[] res) {
System.out.println("Inside loadBitmap 1");
EncodedImage img = EncodedImage.createEncodedImage(res,0,res.length);
System.out.println("Inside loadBitmap 2");
return img.getBitmap();
}
but , its the createEncodedImage() method which is not working properly as the second print statement is not showing up.
Is there something wrong with the code here.
Please suggest ASAP.
Thanks in advance.
|