Solved

Component bitmaps not found

Posted on 2012-04-05
4
368 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 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