views:

131

answers:

2

I've created a WPF project in Visual Studio 2010 using .net 4.0

I've created an icon with many different sizes and formats right from 16x16 4 bit BMP up to 256x256 24 bit BMP. I set it as the program's icon in the property pages for the application, and as the window's icon in the icon propety on a WPF Window.

This works to a point. The icon is displayed in all the expected location, however, it seems invariably to use one of th lower resolution images. In the task bar it apperas to be using a 16x16 image. In the folder if you view the exe file with it set to extra large icons it appears as a tiny image with lots of white space arround it, rather than choosing the large icon. Even if I set it up with a 256x256 icon as the only icon, it seems to scale it down, and then put it in the middle with lots of white space around it.

+1  A: 

See here for some ideas. Also be sure to clean the icon cache (thumbs.db?) to see the updated icon in explorer.

Edit: IcoFx also behaved quite nicely in my tests.

Alex Paven
I can't find a thums.db in the folder (although this would seem a likely solution) However, re-booting the computer does appear to have fixed things.
Tuskan360
Thumbs.db is hidden/system file so you'd need to modify your explorer view options to see it (tools - folder options - view - uncheck 'hide protected system files')
Alex Paven
Thanks, that's sorted now.
Tuskan360
A: 

You must set the image dpi to 96. Be Aware of DPI with Image PNGs in WPF - Images Scale Weird or are Blurry

Douglas