5
votes

What is the right way to define a win7-compatible icon set in a Delphi application ? ( variable size on desktop )

I have designed a 256*256 icon then made the 16*16, 24*24, 48*48 variants. ( in Microsoft UX guide, they seem to say that these sizes should be included for a correct display on the desktop).

I've put all icons variations in a multiple layer document in Gimp and exported the whole stuff as an ico. Then I've put it as the application icon in the project options, following the straight way to assign an icon to an application.

FInally I've put a shorcut on Win desktop (win7) but when making "Ctrl+Wheel" (resizing of desktop icons, if you don't know it yet...) on the desktop (Win 7), correct icon is not displayed, after 48*48 it keeps the same size ( I suspect that only the 48*48 version is used).

1
256px version must be a PNG. Is yours? I would recommend IcoFX to collate your various images into a .ico file. Also, some older versions of Delphi's resource compiler don't support 256px PNG icons. Use MS rc instead if that is the case.David Heffernan
No the 256 px version is not (yet...) compressed.az01
Actually, I think the system does accept a 256px bmp. Still not a great plan though. They are huge!David Heffernan

1 Answers

8
votes

The 256px sized icon should be a compressed PNG icon. I suspect that the resource compiler shipped with Delphi 2007 won't like that format so you'll need to use the MS resource compiler, rc. The icon should be named MAINICON. That said, I suspect that a 256px bitmap will work, it will just be exceedingly large.

What's more, IIRC, the Delphi IDE doesn't like 256px PNG icons so it's no good adding the icon to the project through the IDE. You need to build the .res file yourself and link it with a {$R ...} directive.

Finally, its possible that your .ico file may not be correct. The 256px image is actually stored with width and height equal to 0 because that field is byte sized and 0 was formerly invalid. Perhaps this is what the IDE gags on. Check the .ico file out in a different tool, e.g. IcoFX.

There may be other problems—these are just the ones I can recall encountering over the years. If I had to guess as to which issue was biting you, I'd say it was the inability of the IDE to handle 256px icons.

I believe that the IDE has got progressively better in this area in more recent versions, but even in D2010 which I currently use, it's not perfect.