Frage

I want to add icon to my delphi app. Icon was generated from image via ICOFX, including 128x128 and 256x256 (Vista) icons. I tried to add icon several times:

First of all, using Code Gear IDE: Project Options->Application->Icon. This was an easy way, but Vista-sized icons (128x128 and 256x256) were not added. When scaling in Windows Explorer Ctrl+Wheel, icon stoped increasing in size after 64x64. This happens because Delphi does not support big icons.

Then I tried to change icon in MyProject.RES file (using ResourseExplorer). It did not helped much.

When changing .exe-file icon using ResourseExplorer problems seems to be solved, but this is not a Path of a jedi, obviously. And some problems appears/remains, such as:

  1. when changing .exe-file name (ex: from MEPROG.EXE to _MYPROG.EXE), file icon is changing either (128x128 and 256x256 icons disappeare).
  2. when using MouseRightButton->Send to->Desktop to create a label, label's icon is of small resolution.
  3. copy-pasting exe-file into some other directory(not in deplhi project output dir), could also change icon.

Is there a better way to do this, or I am doing this wrong way?

War es hilfreich?

Lösung 2

See the change-log around 2.7 version

http://andy.jgknet.de/blog/ide-tools/ide-fix-pack/

it seems you just try to use Delphi without installing necessary fixes

PS. another way might be to make some command-line utility replacing icon resource and then auto-call it after compilation phase. Still ugly, but better than manually launchign ResEdit each time.

Andere Tipps

The Delphi 2007 IDE cannot handle large Vista icons, which use PNG compression. And neither can the brcc32 resource compiler that ships with Delphi 2007.

My solution, when I was still using legacy Delphi versions, was to make a .rc file containing the icons, and compile using the MS resource compiler, rc. The MS resource compiler does support such icons, and is readily available, for example with the Windows SDK.

If you do not see the icon, you can just run the following command to clear the icon cache:

ie4uinit.exe -ClearIconCache

For Windows 10, use:

ie4uinit.exe -show

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top