Link to home
Start Free TrialLog in
Avatar of ray_marik
ray_marik

asked on

Component bitmaps not found

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.
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

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...
Avatar of ray_marik
ray_marik

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.