Solved

Component bitmaps not found

Posted on 2012-04-05
4
362 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi TcxGrid group footer summary 3 143
code issue 8 84
find a node in VST 2 46
Create a path if not exists 7 40
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

6 Experts available now in Live!

Get 1:1 Help Now