0

I have an image with transparency which I need to place on the AppWidget. The transparent areas look fine on Motorola Droid, but on some other devices (e.g. HTC Hero) I got a lot of ugly noise. The manual says:

"In some cases, devices have low pixel depths that can cause visual banding and dithering issues. To solve this, application developers should pass assets through a "proxy" drawable defined as XML:. This technique references the original artwork, in this case "background.9.png", and instructs the device to dither it as needed."

Looks like it may be the solution. Unfortunately I need to prepare the widget image dynamically (combining a set of other images together, depending on the data received) and can not create a XML bitmap referencing a static resource.

Is there any way around this?

P.S. I've found out that even when I use a "proxy" XML bitmap with dithering enabled I still get a noise in the transparent areas :(

/Thanks

basv
  • 455
  • 4
  • 11

1 Answers1

0

Generally, you should expect better results scaling a much higher resolution image down (e.g. higher than the HDPI image) - I'd suggest at least 2xHDPI resolutions, to avoid Nyquist artefacts like aliasing.

It's probably worth reading What does the filter parameter to createScaledBitmap do?, as this has some interesting links.

Hope this helps,

Phil Lello

Community
  • 1
  • 1
Phil Lello
  • 8,377
  • 2
  • 25
  • 34