Using XP icons

Posted on 2005-04-26
Medium Priority
Last Modified: 2010-04-24
I have a project, which was initially developed about 6 years ago, and recently migrated into Nisual Studio.NET (2003). All old toolbars were created as 16-color bitmaps. Now I would like to use 32-bit XP icons instead of the old ones. How do I upgrade my resources?

I do have a new set of XP icons, but when I try to copy them on top of my old toolbars, the icons get converted to the old ugly 16 colors. I probably have to change my bitmap palette/depth first, but how? And if so, where do I get the palette? Besides, each XP icon includes several versions (different sizes and color depth). If I copy them on my toolbars (stored by Visual C++ as bitmaps), what happens to these versions?

Question by:olegsp
  • 2
LVL 55

Expert Comment

by:Jaime Olivares
ID: 13871223
A toolbar is associated with a bitmap into your 'res' directory.
Try to open the bitmap externally and change it to 24 bits bitmap with a bitmap editor

Author Comment

ID: 13871279
Did not help. when I reopened the toolbar in visual C++ (after converting it to deeper color), Visual C++ popped an error message "Toolbar must be converted to 16-color bitmap"
LVL 55

Accepted Solution

Jaime Olivares earned 500 total points
ID: 14059584
Recently I discovered a way to load 24 bits transparent images to an ImageList, here is my function:

void CMainFrame::LoadImage24(CImageList &imagelist, int width, UINT resid, COLORREF mask)
      imagelist.Create(width, width, ILC_COLOR24 | ILC_MASK, width, 1);
      CBitmap bmp;
      imagelist.Add(&bmp, mask);

So you can attach this list to a toolbar

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline

749 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