Icon file is invalid in Win7 only with fonts scaled to 125%
The client has their fonts scaled up to 125% on Windows 7-64. This causes our application to crash with this error:
System.ArgumentException: The image argument must be an image that can be used as an icon.
To track down the problem, I downloaded Visual Studio to a virtual machine running Win7-64 Pro and then opened my project. If the font is set to normal (100%) everything works fine, however if I change the Windows display font scaling to 125% and try to build the project I get the same error message from the compiler! That's right, the Visual Studio resource editor tells me that the icon file is not valid, but when I returned the font to 100% everything is fine.
As far as I can tell, this is a valid .ico file. In VS, I can double click on it (from the Resources tab of the project properties) and it opens in the icon editor.
The following sizes are implemented:
- 16x16.32 bit, BMP
- 24x24.32 bit, BMP
- 32x32.32 bit, BMP
- 48x48.32 bit, BMP
- 64x64.32 bit, BMP
- 96x96.32 bit, BMP
- 128x128.32 bit, BMP
- 192x192.32 bit, BMP
- 256x256.32 bit, BMP
- 300x300, 32 bit, BMP
Any ideas?
Thank!
source to share
40x40 is also required.
While reading this post: What icon sizes should my Windows app icon contain?
I noticed a mention of a 40x40 pixel image that I had never seen before, but 40 is just 125% of 32, so I tried it.
While 40x40 is not one of the normal sizes created by the icon maker tools I used, I was able to edit the icon file and manually add that size using the icofx free trial (www.icofx.ro).
Now our application runs on Win7 with 125% larger fonts.
-Luck that helps someone.
source to share