Can you use VISTA sized icons when you use 'Load icon' in Delphi 7?
I cannot load icons which contain Vista sized icons when using the 'Load icon'开发者_开发百科 in the application tab of Delphi 7.
Does someone knows how to display icons bigger than 48x48 in Vista and Windows 7 using an application developed in Delphi 7?
A icon is a collection of images. Starting with Windows Vista support for PNG compressed images has been introduced, and in fact when you say "Vista icon" the graphics designer takes it as a icon containing the PNG image (among other sizes).
Solution (1): Remove the 256x256 PNG image, the 128x128 alpha-channel images are quite enough and they do work with Delphi 7. And don't feel too bad about it, Visual Studio had (has???) lots of problems with PNG compressed images itself!
Solution (2): Use a Delphi-7 compatible icon for the build and after Delphi gives you the Exe replace the icon with the one you want, using some tool (ResourceHacker is free and works fine for me, it can be controlled from the command-line so I can use it in my automated builds)
It is VERY EASY to add high resolution icons in your Delphi 7 exe: http://thesunstroke.blogspot.com/2010/10/how-to-add-high-resolution-icons-to.html
I just found out that the problems I was having - and the reason why I asked the question in the first place - was due to the fact that the 256 x 256 image in my .ico file was a PNG compressed format.
I am using Iconworks to edit my icon files. Right clicking the 256 x 256 image and unchecking the 'PNG image compressed format (Windows VISTA)' option, and saving the ico file again, solved my problem. Delphi 7 reads, merges and used the icon file just fine now.
It does make the icon file much larger though.
I hope this helps others.
精彩评论