Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

adding icons to a .res file

Posted on 2000-02-14
19
Medium Priority
?
225 Views
Last Modified: 2010-04-04
how can I add a .ICO file to my .RES file?
0
Comment
Question by:jchua
[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
19 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 510 total points
ID: 2518075
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
ID: 2518233
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
ID: 2520967
Adjusted points to 80
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:jchua
ID: 2520968
how do i create a .rc file?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2521007
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
ID: 2521070
Adjusted points to 90
0
 

Author Comment

by:jchua
ID: 2521071
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
ID: 2521516
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
ID: 2521521
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
ID: 2521579
Adjusted points to 140
0
 

Author Comment

by:jchua
ID: 2521580
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
ID: 2521765
Did bcc32 report any errors when it compileed the .res file?
0
 
LVL 17

Expert Comment

by:geobul
ID: 2521822
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
ID: 2525482
Adjusted points to 160
0
 

Author Comment

by:jchua
ID: 2525483
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
ID: 2525524
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
ID: 2525576
Adjusted points to 170
0
 

Author Comment

by:jchua
ID: 2525577
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
ID: 2525733
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

670 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