Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Pascal
Expertise: Beginner
Mar 19, 1997

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.

  1. Run the Delphi Image Editor
  2. 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
  3. Select the "Component Resource(DCR)" radio button
  4. Click the OK button
      Untitled1.DCR dialog appears
  5. Make sure you're on the Bitmaps tab
  6. Click on the New button
      New Resource dialog appears
  7. Select the Bitmap radio button
  8. Click on the OK button
      New Bitmap Attributes dialog appears
  9. In the "Size in Pixels" frame, change the Width and the Height to 24.
  10. Click the OK button.
  11. The Bitmap Editor now appears, so go to work.
  12. Close the Bitmap Editor when finished
  13. 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.
  14. Repeat steps 5 through 13 to add additional bitmaps for other components that reside in the same unit.
  15. 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.
  16. Rebuild your library, and your new bitmap should appear.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date