title: Best way to make a component icon in Delphi XE using only the built in tools
body: <p>In Delphi 7, an image editor program is included, which can read and write <code>.dcr</code>  files, which are merely binary resource files (<code>.res</code> files) with a different extension, which by convention indicates that the .dcr file contains a compiled resource with named bitmap resources that have names corresponding to your component names (a bitmap resource named TMYCOMPONENT for a component named TMyComponent).  These bitmaps are where the "icons" used to put an icon on the delphi component palette, and on your form or data-module when you drop a non-visual component on it, come from.</p>
  
  <p>Fast forward 10 years to Delphi XE, and I am trying to make component icons using a bitmap file, and an RC file, and have that build to a .DCR file, as part of the Delphi IDE.</p>
  
  <p>It should be simply a matter of adding an .Rc file and a declaration like this in the .dpk (package source) file, like this:</p>
  
  <pre><code>{$R mypackageicons.rc mypackageicons.dcr}
  </code></pre>
  
  <p>A sample .rc file containing a component icon:</p>
  
  <pre><code> // COMPONENT ICON RESOURCES
   TMYCOMPONENT BMP "TMYCOMPONENT.BMP"
  </code></pre>
  
  <p>However I can not get this to work. It seems that you get some bizarre RLINK32 errors, and IDE crashes in borlandmm.dll, when I try it:</p>
  
  <pre><code>[DCC Error] E2161 Error: RLINK32: Unsupported 16bit resource in file "C:\temp\compicon\COMPONENTICONS.rc"
  [DCC Fatal Error] F2084 Internal Error: AV21515155-W06000D07-1
  </code></pre>
  
  <p>The bitmap file in question is a simple 256 color bmp file size 24x24 pixels, and I have also tried 16 color bitmaps, with no luck.  It seems to me that the ImageEdit program is the only way that I know of that I can use to create Delphi component icons.  </p>
  
  <p>What am I missing out on?  </p>
  
  <p><strong>Update:</strong> The external tools are a nice solution for people who don't have access to the Delphi 7 image editor, and may in fact be superior, but I would prefer to do this using only what ships with Delphi, because it seems that it should be possible using just one {$R} declaration, a text file, and a bmp file made with paintbrush. Surely they didn't omit to make a way to make component icons, with this great big  1.5 gigabyte developer tool! .. <strong>update2:</strong> And there is a way; Rudy V. found it.</p>