[android-developers] BitmapFactory 's decodeByteArray and decodeStream returns null
I am trying to decode ARGB byte array into bitmap to display it as an image view. I tried using BitmapFactory's decodeByteArray() and decodeStream() but both way gives null as Bitmap. But when I create bitmap using createBitmap () and setPixels it works perfect. Here is the working code. data is the byte array of size imageWidth*imageHeight*4 int[] pixels=new int[imageWidth*imageHeight]; int i=0,j=0; while (ihttp://groups.google.com/group/android-developers?hl=en
Re: [android-developers] BitmapFactory 's decodeByteArray and decodeStream returns null
Hello Oscar, Thanks for the reply. But I already tried this approach. ByteArrayInputStream imageStream = new ByteArrayInputStream(data); Bitmap theImage = BitmapFactory.decodeStream(imageStream); *theImage* returned by *decodeStream* is null. Regards Siji -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: BitmapFactory 's decodeByteArray and decodeStream returns null
Thanks for the reply Zsolt. My data stream comes from h264 video decoder , which is native. Format of this data stream is ARGB. Please note that I could display this image correctly using Bitmap. createBitmap() and setPixels () . Regards Siji -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: BitmapFactory 's decodeByteArray and decodeStream returns null
Thanks Donug, I think , this will help. Let me try... Regards Siji -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: BitmapFactory 's decodeByteArray and decodeStream returns null
Donug, You mean to use bitmap.h ?? Could you please provide me some sample code in C for setting pixels of bitmap. I have data in jbyteArray out_buf. How to set out_buf as pixels of bitmap?? Thanks in advance. -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: BitmapFactory 's decodeByteArray and decodeStream returns null
.Donug, My issue is already solved. Thanks any way. -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: BitmapFactory 's decodeByteArray and decodeStream returns null
Sorry for that typo. Actually it was a bug in my h264 video decoding native code ,which caused the problems And i am still a new be in C. As I now understand decodeByteArray() can decode compressed image data of format PNG and JPG and my image data is of type ARGB. Any way my problems solved. Thanks every one , for the help. Regards Siji -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en