Solved

Programs and Icons

Posted on 1998-06-08
11
218 Views
Last Modified: 2010-04-01
I just created a text game, and I want to know how to make one of my BMP files into an icon for the game.  Is there anyone who can help me do this?

~Topace~
0
Comment
Question by:Topace
  • 6
  • 5
11 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 10 total points
ID: 1165425
If you mean to create an icon from within your program (to be used within the game), you can use CreateIcon().  If you mean to create and icon to be associated with your program, then use a resource editor to create the icon and then specify the icon in the program's resurces.  

I can provide more info if you explain what it is you need.
0
 
LVL 1

Author Comment

by:Topace
ID: 1165426
What I want to do is just create an icon (Like all windows programs have) to represent my program on my desktop and the desktop of my collegues that will be using the program.  (Such as an <filename>.ico file)  What I need to know is this:

What program to use in order to make it, (Paint Shop Pro, Embellish, MS Paint, Etc..)

What to save it as (Filename.ico, or filname.bmp and then convert it?)

What the size should be (The size of the image)

Do you know these things?

~Ace~
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165427
>> What program to use in order to make it, (Paint Shop Pro, Embellish, MS Paint, Etc..)
Note that and icon (.ico) is not the same as a bitmap (.bmp).  Paint does not have the ability to make icons (as far as I know).  I don't know about the others.  Most windows programming environments (IDEs) contain utilities to create icons.  What are you programming in?  Also the windows SDK has a icon utility.

What to save it as (Filename.ico, or filname.bmp and then convert it?)
ico  It is not a bitmap.

What the size should be (The size of the image)
Each icon can file can contain different images (bitmaps) in it.  this is so the OS can sellect the one with the best size and colors.  You will want at least a 32X32 16 color image.  You also might want a 20X20 16 color  (this is for the smaller icon that apears in the caption.)  You can provide others as well.  Note that the OS will scale images if it can't find one of the size it needs.

Can you find and icon editor with your compiler program (IDE)?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Topace
ID: 1165428
Actually, I have found that saving a BMP file in PAINT as .ico creates an icon.  Do you know how I could icorporate this into my program so that the automatic icon for that specific EXE file is the .ico file I create in PAINT?


~Topace~

P.S.  Is there an icon maker on the internet I could download?  I am using DJGPP, with RHIDE as my IDE.  It is a free compiler off the internet, as I am saving for VCPP and need a compiler for the time being.



0
 
LVL 22

Expert Comment

by:nietod
ID: 1165429
I don't know of any free icon makers on the net.  In fact I don't know of anything free on the net. This site is about it for me.  

Does paint have an option to save the file as an icon file?  Just saving a bitmap format with an ico extension is not enough.  They do not have the same formats.  An icon can contain multiple bitmaps (different sizes and color depths) Plus the images have masks that indicate what portions of the image should be considered background, and should be "transparent".  I'm not saying that paint doesn't produce this format.  I'm just saying you should make sure it does.

Assuming you have an icon file with the correct format, you just need to compile it to a resource file and link the resource file into your program.  The typical way this is done is to create a resource source code file  (.RES) that contains a line like

ICON_ID ICON "C:\SOMEPATH\SOMEFILE.ICO"

Where ICON_ID  is the name or number you want to use to identify the icon from within your program.  The resource compiler can understand C++ constant definitions so you could define ICON_ID as a constant in an include file that gets included into the resource source code file (.RES) and into the C++ source code file (.CPP).  The path is the path to your icon file.  the resource compiler will produce a compiled resource file (.rc) that contains the binary data of your resources.

The binary resource file (.rc) must be linked into the final program using the linker.  In most cases, you can just list the file in the same way you would list an object code file (.OBJ).

I recommend moving to VC++ as soon as possible.  I suspect it will makle your life a lot easier,  if not your back account a little less richer.
0
 
LVL 1

Author Comment

by:Topace
ID: 1165430
Yeah, I need VC++.  But, how do I make resource files?  AND -- Since I am currently just saving a BMP file with an ICO extention, what could I use to MAKE the icon file?


~Topace~
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165431
The only way I know to make a resource file is with a resource compiler.  These come with the comming programing IDE's like VC and BC.  There may be some others on the market or free, but I don't know of any.

The only way to edit an icon that I know of is with an icon editor.  These also are available with VC and BC.  There was also one with the windows SDK.

I have a copy of the SDK one, if you post your e-mail address I could e-mail it to you.  Its not very good, but It gets the job done--barely.  You could e-mail me at nietod@theshop.net if you don't want to post your e-mail.
0
 
LVL 1

Author Comment

by:Topace
ID: 1165432
Email:

Topace@geocities.com

Does it just put all the BMP files together to form an ICO file?


~Topace~
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165433
No.  It is an editor.  There is more to an icon than a bitmap image.  icons also have masks that indicate what portion of the rectangular image is really part of the icon and what part should be made transparent and not treated as part of the icon.

It also edits cursors and I think something else.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165434
I sent the program yesterday, but I got a message back that it wasn't able to deliver but would keep trying.  Did you get the file?
0
 
LVL 1

Author Comment

by:Topace
ID: 1165435
Thanks.

I appreciate yuour help.


~Topace~
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 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