Assigning Component Icons

Posted on 1999-06-24
Medium Priority
Last Modified: 2010-04-06
How do you put an icon into a component(that i've made) so that when you install it, it comes up on the component pallete with my own icon?

Question by:captainklink
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Accepted Solution

simonet earned 200 total points
ID: 1384398
A component image (because it's a bitmap, and not an icon) is bitmap resource with a special name contained in a resource file with extension .DCR.

In order to create this resource file, you can use Image Editor (that comes with Delphi).

Here are the steps to follow:
1) Open Image Editor
2) Select File| New | Component Resource File (.dcr). A new resource file with extension .dcr will be created
3) Now select Resource | New | Bitmap. When Image Editor asks for the image size, select 24x24
4) Now just create the bitmap for your component using the tools provided by Image Map.
5) Now close the bitmap. On the untitled.dcr window (the "resource's project"), click once on the Bitmap1 caption and change its name to the name of your component, use all uppercase letters (example: TDBMYEDIT)
6) Save the DCR file using the same name of the PAS file where your component is. If the PAS file is myedit.pas, then save the DCR file as myedit.dcr
7) in the .PAS file for your component, add a line like:
{$R myedit.dcr}
8) Rebuild the package where the component is.
9) That's it.


Athena's Place: http://www.bhnet.com.br/~simonet


Author Comment

ID: 1384399
Thanks, very helpfull!!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question