try something like this:

byte[] data = getData();
Bitmap bm=null;
ByteArrayInputStream bytes = new ByteArrayInputStream(data);
BitmapDrawable bmd = new BitmapDrawable(bytes);
bm = bmd.getBitmap();

On Dec 8, 11:51 pm, shuoshuo <[EMAIL PROTECTED]> wrote:
> Hi,
>    Anyone' help is appreciated.
>    I now want to create bitmap using a byte array which contains the
> pixels data, one byte correspond one pixel.
>    But I found that the no api of bitmap accept bytearray, only int
> [] , 4 bytes correspond one pixel. If I convert my bytearray to int[],
> it will cost too much memory.
>    Do anyone know how to display the image using my bytearray
> directly? Thanks a lot !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to