简体   繁体   中英

Icon file invalid in Win7 only with fonts scaled to 125%

A customer has his fonts enlarged to 125% on Windows 7-64. This causes our app to crash with this error:

System.ArgumentException: Argument 'picture' must be a picture that can be used as a Icon.

To track down the problem, I loaded Visual Studio onto a VM running Win7-64 Pro, 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 the icon file is not valid, but when I put the font scaling back to 100%, everything is OK.

As far as I can tell, it is a valid .ico file. In VS, I can double-click on it (from the Resources tab of 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?

Thanks!

40x40 is also needed.

While reading this post: Which icon sizes should my Windows application's icon include?

I noticed mention of 40x40 pixel image, which I'd never seen before, but 40 just happens to be 125% of 32, so I tried it.

Although 40x40 isn't one of the normal sizes created by the icon-generator tools I've used, I was able to edit the icon file and manually add this size using the free trial of icofx (www.icofx.ro).

Now our app runs on Win7 with 125% enlarged fonts.

-Hope that helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM