I ask if there is a simple way because there is a google issue report saying that using decodeByteArray isn't possible. But that report originated in 2008 and I was hoping there was a solution not posted on there. The method listed on the issue report was to decode the format yourself, but I'd prefer to not have to put that in and slow down the program. Any help at all would be appreciated.
views:
161answers:
1
+1
A:
The easiest way is to create a BufferedImage the following way:
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0. data.length);
data is the byte array.
Roflcoptr
2010-07-23 19:07:04
Um are you sure that works in Android? I can't find any reference material for BufferedImage or ImageIO. Its listed in the Java language reference but not Android's
RyoxSinfar
2010-07-23 19:27:11
Yes i copied the wrong code. I modified my answer. Sorry.
Roflcoptr
2010-07-23 19:30:23
THats what I originally thought the answer was, but it gives me a null bitmap back.
RyoxSinfar
2010-07-23 19:33:18