Solved

adding icons to a .res file

Posted on 2000-02-14
19
199 Views
Last Modified: 2010-04-04
how can I add a .ICO file to my .RES file?
0
Comment
Question by:jchua
19 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 170 total points
Comment Utility
You can do this by running the Resource Workshop (which comes with D5) and editing .res file to include the icon.

Or, you can create a .rc file that looks like this:

1   ICON   "MyIcon.ico"

Then compile that to a .res file usung brcc32.exe in the delphi bin directory like this:

brcc32 MyRes.rc

Then include the res file in your app by including this line in the .DPR file:

{$R MyRes.res}

Cheers,

Raymond.
0
 
LVL 15

Expert Comment

by:simonet
Comment Utility
Check out Athena's Place: http://www.bhnet.com.br/~simonet
and go to the How-To Projects page. There you'll find a couple demo applications (w/ source) that will teach how to deal with resources.

Alex
0
 

Author Comment

by:jchua
Comment Utility
Adjusted points to 80
0
 

Author Comment

by:jchua
Comment Utility
how do i create a .rc file?
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
For simple stuff like puttin an icon in a res file just use a text editor and do this:

1   ICON   MyIcon.ico

Then save it and follow the steps I outlined above...

Also look at simonets sample project - it quite good, though it is oriented towards resource DLLs, it will show you some useful information.

Cheers,

Raymond.


0
 

Author Comment

by:jchua
Comment Utility
Adjusted points to 90
0
 

Author Comment

by:jchua
Comment Utility
I was able to create MyRes.RES file but when i opened it in the image editor of Delphi I could not view or edit the icon i added.
0
 

Author Comment

by:jchua
Comment Utility
I was able to create MyRes.RES file but when i opened it in the image editor of Delphi I could not view or edit the icon i added.
0
 

Author Comment

by:jchua
Comment Utility
I was able to create MyRes.RES file but when i opened it in the image editor of Delphi I could not view or edit the icon i added.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:jchua
Comment Utility
Adjusted points to 140
0
 

Author Comment

by:jchua
Comment Utility
Last question, hopefully, can i add an existing .ico file to my existing .res file using any of the methods mentioned?
ex. using d resource workshop?
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
Did bcc32 report any errors when it compileed the .res file?
0
 
LVL 17

Expert Comment

by:geobul
Comment Utility
Hi,

adding new icon to res file with Delphi Image Editor:

1.Open res file.
2.Expand 'Contents-Icon'.
3.Right click on Icon and select New-Icon from the popup menu.
4.Select the size and colors you want and press OK.
5.From main menu select File-Open and open your existing ico file.
6.From main menu select Edit-SelectAll and then Edit-Copy.
7.Close ico file.
8.Right click on new icon from res file and select edit from popup menu.
9.From main menu select Edit-Paste.

Regards, Geo
0
 

Author Comment

by:jchua
Comment Utility
Adjusted points to 160
0
 

Author Comment

by:jchua
Comment Utility
No rwilson, the brcc32 did not report any errors.
when i opened the .res file, the icon is present but i cant edit it or even view it...
can i add icons in my res file without erasing the old icons in the res file?
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
You should be able to add items to the res file using the image editor:

Right-click on the contents item in the tree view, select new and a popup will appear asking you to choose the type of resource to add...

Cheers,

Raymond.
0
 

Author Comment

by:jchua
Comment Utility
Adjusted points to 170
0
 

Author Comment

by:jchua
Comment Utility
Yes raymond, but i have to cut and paste the image in the image editor in order to add it... what i am asking is how can i add an existing .ico file to my .res file???

example :
add  myface.ico to myres.res

how do i do this?

can i use the image editor for this??
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
No, I don't believe you can. But then cutting and pasting isn't that bad unless you have LOTS of them!

Cheers,

Raymond.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

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

11 Experts available now in Live!

Get 1:1 Help Now