?
Solved

Component bitmaps not found

Posted on 2012-04-05
4
Medium Priority
?
369 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
[X]
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
  • 2
  • 2
4 Comments
 
LVL 23

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 23

Accepted Solution

by:
Ferruccio Accalai earned 2000 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

Industry Leaders: 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

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 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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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