Well something isn't working correctly and I don't think it's aapt, unless aapt is somehow causing the PNG to lose some information that the decoder uses. I'm using PNGs encoded by photoshop with obvious transparency (some with 100% in areas, others with partially transparent pixels) and many of them are decoded with a null bitmap configuration or as RGB_565.
I've been having this problem for a year but I have just been using workarounds. It was just today that it got on my nerves :) On May 14, 5:42 pm, Romain Guy <romain...@android.com> wrote: > aapt will optimize PNGs already, no need to do it in Photoshop. That > also means, for instance, that if your PNG does not have any > transparent pixel, aapt will detect that and turn your PNG into an > opaque PNG, hence giving you a 565 image. There are other > optimizations too (for instance, if you have < 256 colors, a paletted > image is generated.) > > > > > > On Fri, May 14, 2010 at 2:36 PM, Robert Green <rbgrn....@gmail.com> wrote: > > I've been dealing with this issue for some time but it's really > > causing me problems today. > > > Here's what I'm doing: > > > BitmapFactory.Options opts = new BitmapFactory.Options(); > > opts.inScaled = false; > > return BitmapFactory.decodeResource(context.getResources(), > > resourceId, opts); > > > And on many PNGs exported from Photoshop using "save for web and > > devices" which is the optimized way to do it, I get a Bitmap that > > should be ARGB_8888 but ends up as RGB_565. Not only that but > > Bitmap.getConfig() returns null on those, as if it didn't know what > > format it put it in. > > > Gosh that seems buggy! > > > Anyone have a good workaround for this which allows for loading > > unscaled bitmaps in their correct format (with transparency?) > > > -- > > 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 > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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