6
votes

Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette.

I've read that I should name my two other BMP files which are contained in DCR file like this:

MyComponentName16 [for 16x16 BMP file]

MyComponentName32 [for 32x32 BMP file]

Unfortunately this does not seem to work, I've tried to restart Delphi few times in hope that it might be the case of not refreshing something, but without any success.

Any ideas?

1
Which is the bit depth of the bmp that you are using?RRUZ
If you change (od just add) the package resources like those icons, try to open your package, uninstall it, then add the resources, include them into the desired units, re-build the package and install it back (rather than restarting IDE). Or if you did all of this, you might encountered the problem with cached packages (like described e.g. here, maybe there was even some command line parameter for cache clearing, not sure with it).TLama
In the accepted answer to the question you linked, did you see the comment about the image names having to be in CAPS? (For instance, TMYCOMPONENTNAME16.BMP and TMYCOMPONENTNAME32.BMP.) The all-caps requirement has existed since Delphi 1; it's related to loading the resources by name in the IDE.Ken White
This is an area where Delphi just plain sucks. The IDE could really help out here to hide ugly low level details, but it doesn't.Wouter van Nifterick
Thank you guys for your interest. I've tried many times to reinstall the packagae without any success, I had the names in uppercase and bit depth was 24. @TLama I did not expect that solution under link you gave will work, but it worked:) Could you promote your comment to the answer?Wodzu

1 Answers

8
votes

You may try to clear the IDE package cache:

  • uninstall the component's package from your Delphi IDE
  • in registry browse to the following key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Package Cache\
  • find and delete the key corresponding to your package name (like MyPackage.bpl)
  • now browser to the next key
    HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Palette\Cache\
  • find and delete the key corresponding to your package name (like MyPackage.bpl)
  • and finally try to install your package back; now it should appear with proper icons

Source: http://www.lnssoftware.ca/blog/?p=140

As another workaround you might try to run Delphi IDE with undocumented command line parameter:

c:\Program Files (x86)\CodeGear\RAD Studio\6.0\bin\bds.exe -nocache