How do I create a bitmap for the component palette?
Question:
I created a new edit control component which I derived from TEdit,
however, when I added it to the component palette, it has the same
bitmap as TEdit. How do I replace it with my own?
Answer: Follow these easy steps. The only difficult one will be deciding
on a bitmap.
Run the Delphi Image Editor
Select File|New... or click on the toolbar button that tool tip
label of "New..." appears when the mouse point rests over it.
New Project dialog appears
Select the "Component Resource(DCR)" radio button
Click the OK button
Untitled1.DCR dialog appears
Make sure you're on the Bitmaps tab
Click on the New button
New Resource dialog appears
Select the Bitmap radio button
Click on the OK button
New Bitmap Attributes dialog appears
In the "Size in Pixels" frame, change the Width and the Height to 24.
Click the OK button.
The Bitmap Editor now appears, so go to work.
Close the Bitmap Editor when finished
Rename the bitmap resource to match the name of the component
you want the bitmap to represent on the component palette by
selecting the resource and clicking on the Rename button. It will
not appear on the component palette if the name is not identical.
Although it is not case sensitive, the convention is to use all caps
for the resource name.
Repeat steps 5 through 13 to add additional bitmaps for other
components that reside in the same unit.
Save the project file in the directory of where the compiled unit
that contains your component(s) reside(s). You must give it the same
name as the unit except your project file should have a .DCR
extension.
Rebuild your library, and your new bitmap should appear.