Solved

creating an icon

Posted on 2001-06-22
6
201 Views
Last Modified: 2006-11-17
Hi,
  I want to create an icon by using vc++. I have no idea about this please somebody tell me. I need step by setp instructions. And where can I find the vc++ tutorial for creating icons.
thanks
0
Comment
Question by:samsuni
6 Comments
 
LVL 2

Expert Comment

by:pesst
ID: 6220615
Go to the Insert -> Resource

then select icon

then you can add an icon or create a new one

save your icon to somthing.rc

after you do that then right click on the resources folder in the file view  and click add files to folder

select the .rc file you just created

compile and thats it
0
 
LVL 2

Expert Comment

by:pesst
ID: 6220620
sorry, that actual icon will be something like icon1.ico

the resource script will be somthing.rc

0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6221035
You must use CreateIcon API. Description
CreateIcon      

The CreateIcon function creates an icon that has the specified size, colors, and bit patterns.

HICON CreateIcon(

    HINSTANCE hInstance,     // handle to application instance
    int nWidth,     // icon width
    int nHeight,     // icon height
    BYTE cPlanes,     // number of planes in XOR bitmask
    BYTE cBitsPixel,     // number of bits per pixel in XOR bitmask
    CONST BYTE *lpbANDbits,     // pointer to AND bitmask array
    CONST BYTE *lpbXORbits      // pointer to XOR bitmask array
   );    
 

Parameters

hInstance

Identifies the instance of the module creating the icon.

nWidth

Specifies the width, in pixels, of the icon.

nHeight

Specifies the height, in pixels, of the icon.

cPlanes

Specifies the number of planes in the XOR bitmask of the icon.

cBitsPixel

Specifies the number of bits per pixel in the XOR bitmask of the icon.

lpbANDbits

Points to an array of bytes that contains the bit values for the AND bitmask of the icon. This bitmask describes a monochrome bitmap.

lpbXORbits

Points to an array of bytes that contains the bit values for the XOR bitmask of the icon. This bitmask describes a monochrome or device-dependent color bitmap.

 

Return Values

If the function succeeds, the return value is the handle to an icon.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

The nWidth and nHeight parameters must specify a width and height supported by the current display driver, because the system cannot create icons of other sizes. To determine the width and height supported by the display driver, use the GetSystemMetrics function, specifying the SM_CXICON or SM_CYICON value.
CreateIcon applies the following truth table to the AND and XOR bitmasks:

AND bitmask     XOR bitmask     Display
0     0     Black
0     1     White
1     0     Screen
1     1     Reverse screen

Ftrom this you see, that you must simple prepare

....
For this you see, that you must simple prepare
lpbANDbits and lpbXORbits arrays , and use this API.



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

 
LVL 1

Expert Comment

by:ua1zcl
ID: 6222327
About tutorial. If help files on your VC installed, choose menu
Help -> Search, in Search dialog box type: creating icons.

0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 75 total points
ID: 6262001
I hope, my comment helps you. Alex
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6883868
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20277023.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.11674378.html
http://www.experts-exchange.com/questions/Q.20140440.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 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