Icons for RCP

When building an Eclipse RCP product, you have the ability to generate a native executable.  By default the icon associated with the executable is the Eclipse graphic.

There’s an option in the product definition (‘.product’ file) that lets you use your own icons.

There are two ways to attach the icons …

  • Six different BMP files – 16×16, 32×32, & 48×48 at 32 bit & 8 bit depths.
  • A single ICO file with all six graphics included.

I was struggling with creating the graphic files I needed.  I had no problem getting the 32 bit version of the files created, but couldn’t figure out how to create the 8 bit version.

Then I found Eitch’s Blog post on Creating icons for eclipse applications.

You just need to change the mode to indexed and then change the maximum number of colors to 255 for 8bit.

After a bit of fumbling around with Gimp menu options I found what I needed …

  1. Load the image into Gimp
  2. Click on the Image menu, select Mode, then select Indexed.
  3. The Convert Image to Indexed dialog shows up.
  4. Select the “Generate optimum palette” with a “Maximum number of colors of 255″.
  5. Same the image (with a new name).

If you want to create a single ICO file with all six image formats, use the convert program in ImageMagick

convert icon16x16x32.bmp icon16x16x8.bmp icon32x32x32.bmp [...]
-channel Alpha -negate image.ico

FWIW: Apparently Photoshop can create the 8 bit images directly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.