Using XP icons

Posted on 2005-04-26
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
    LVL 55

    Expert Comment

    by:Jaime Olivares
    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
    LVL 1

    Author Comment

    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

    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

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    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++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    732 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

    23 Experts available now in Live!

    Get 1:1 Help Now