Solved

Custom components issue n. 2

Posted on 2014-01-25
2
348 Views
Last Modified: 2014-01-26
Hi all.

For one of the components mentioned in my other question (http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28348188.html), I can't have the icon correctly displayed.

I created a dcr file with ResourceBuilder. Here I added a bitmap 32x32 256 colors calling it with the same of the component in uppercase. The in the unit I use to register the component I wrote the directive

{$R name_of_resource_file.dcr}

For some component works well, for others not and I can't find the difference.

Thanks in advance for any advice.
0
Comment
Question by:Marco Gasi
2 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39810174
Icon must have same name as class name: TMyClass  -->  TMYCLASS.
Use name notation depending on size of image:

TMYCLASS BITMAP "MyClassImg24x24.bmp"
TMYCLASS16 BITMAP "MyClassImg16x16.bmp"
TMYCLASS32 BITMAP "MyClassImg32x32.bmp"

Make sure that your bitmap is a real 256 colors (8bit).

Additional help in this blog about rebuilding component image cache:
http://www.lnssoftware.ca/blog/?p=140
0
 
LVL 30

Author Closing Comment

by:Marco Gasi
ID: 39810208
Thanks, it solved the problem.
Cheers
Marco
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now