Solved

Component bitmaps not found

Posted on 2012-04-05
4
363 Views
Last Modified: 2012-08-13
I'm trying to make a component with XE and having trouble with both the bitmaps the component uses and the bitmap that represents the component inside the IDE. Do I need to import all the bitmaps into project or just the rc and where do I reference the rc file? If someone can provide a step by step on making a simple component based on, let's say, TImage that has its background bitmap set from resource, I would really appreciate it. So the component has both a res and a dcr file, and I'd like to know how to include both. Thanks in advance.
0
Comment
Question by:ray_marik
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 37812853
For the Component icon you should do:
Add a 24x24 bitmap using the Project->Resources and Images... dialog to the .dpk and give it the same name as the component (i.e. if the component name is TMyComponent the bitmap should have the same exactly name).

I think you can use the same way to add an image to the resource but if not you have to compile the rc with the image linked, into a .res file
brcc32 yourfile.rc -fo yourfile.res and then include the .res in your package

package MyPackage
{$R yourfile.res}
etc...
0
 

Author Comment

by:ray_marik
ID: 37813241
I've tried adding bitmaps to the project via "Project>Add to project" and compiling. I see that {$R *.res} is added to the dpk file and it gets compiled and added to IDE, but on component drag/drop usage, I get the error msg "Bimap_1 not found".

Also if I compile the rc file myself and add this to the unit {$R myComponent.res}, on compiling I get the error that duplicate res files found.

What's  going on here?
0
 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 500 total points
ID: 37815299
If you have the bitmap into the two .res files it raises the duplicate resource error for sure.
take a look here to understand better how to work with XE http://stackoverflow.com/a/7000218
0
 

Author Comment

by:ray_marik
ID: 37816670
As mentioned in the article, the problem was on XE, {$R *.dres} gets added multiple times to the package. Removed them and it works now.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

28 Experts available now in Live!

Get 1:1 Help Now