Fix Windows Phone 7 (WP7) gradients in emulator/phone.

May 14, 2012
Windows Phone 7 (WP7)

While developing Apps for Windows Phone 7 using gradients you might notice they look fine and smooth in Visual Studio or Blend but not in emulator or on Windows Phone device. You can see quality decrease and horizontal streaks making the transition less subtle.

The reason for it is your App is using 16bits per pixel color depth settings. To force your app to use 32 bits per pixel you have to set the attribute BitsPerPixel value to 32 in the App Manifest File.

You can find the Windows Phone App Manifest file from Solution Explorer under properties and the file name is by default WMAppManifest.xml.

Your file should look something like this:

<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1">
<App xmlns="" BitsPerPixel="32" ProductID="{}" Title="App Title"...

16bit vs 32bitNothing guarantees that devices will have 32 bit deep display hardware but all the newer devices should have it. And remember BitsPerPixel is supported only in Mango.

But remember that this will require more memory and processing power from the phone, so more battery power will be drained faster. So only use it when it’s necessary.

Other way is to just dither your image to 16bit on Photoshop if you are using PNG images instead of built in gradients.