ibogolyubskiy
ibogolyubskiy

Reputation: 2291

PNG with gradients rendering

I use in my program PNG images with gradients. Images look fine in design mode on the computer, but on emulator and on device there is a incorrect rendering of gradient on PNG image (it looks like as picture of isotherms from school course of Geography).
Found this post about it: Is there a way to render PNG with gradients in Internet Explorer Mobile 7 correctly?
It works fine, but when I use DoubleAnimation for this image (I change an Opacity property of control from 0.0 to 1.0), gradient rendering bug appears again. It looks ugly, so is this possible to play DoubleAnimation of PNG image with gradients without these "isotherms"?

Thanks.

Upvotes: 2

Views: 565

Answers (2)

Pedro Lamas
Pedro Lamas

Reputation: 7243

You can do as @ColinE suggestion and set BitsPerPixel to 32bit, but be advised that this will require more memory and processing power from the phone, so more battery power will be drained!

Other way is to just dither your image to 16bit on Photoshop or some other app that has a palette dithering functionality.

Upvotes: 2

ColinE
ColinE

Reputation: 70142

Try setting your application to use 32 bits per pixel. In your manifest file add the following:

BitsPerPixel="32"

See this blog post for an example.

Upvotes: 4

Related Questions