Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8156483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:58:00+00:00 2026-06-06T16:58:00+00:00

I am developing an MFC application. I am working with my own .bmp image

  • 0

I am developing an MFC application. I am working with my own .bmp image with Visual Studio. I import bmp via the add resource dialog, give it a unique name and create a CImageList. I am then setting the image list in a list control:

CListCtrl m_CIDList;
CImageList m_ImgList;

//.........

m_ImgList.Create(IDB_MYBITMAP, 15, 0, RGB(255, 255, 255));
m_CIDList.SetImageList(&m_ImgList, LVSIL_STATE);

The problem I am having is strange. Only certain colors will show up, usually only red and grey. I have tried using different Bit Depths, but that has changed nothing.
Here is what the bmp looks like in the image editor in VS:

BMP image in editor

When the icons are displayed in the list control, only a few of the reds are showing up and all of the green shows up as grey.

I am not quite sure what is going on, does anybody have an idea of what is happening?

Solution Update

m_ImgList.Create(15, 15, ILC_MASK | ILC_COLOR24, 0, 0);
CBitmap bmp;
bmp.LoadBitmap(IDB_MYBITMAP);
m_ImgList.Add(&bmp, RGB(255, 255, 255));
m_CIDList.SetImageList(&m_ImgList, LVSIL_STATE);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:58:03+00:00Added an answer on June 6, 2026 at 4:58 pm

    When the image list is created and no color value is given, the default color mode is ILC_COLOR4 which only allows 16 predefined colors for the image. All of the colors in your bitmap are being mapped to those 16 colors.

    Use ILC_COLOR24 for full color bitmaps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing MFC Dialog based application in Visual Studio 2008. I want to
I'm developing an interactive MFC application which displays a 3D object using my own
I am developing windows CE 6.0 for VIA board. I have a MFC application
I'm developing an AutoCad plugin (MFC dll), I'm using Visual Studio 2010 and C++.
I have experience developing MFC applications with C++ using Visual Studio 6.0. You can
Developing a multilingual application in VB.Net 2008, Im able to add resources to forms
I am developing a Windows API application without using MFC . I am using
I am developing an image viewer/editor using VS2008 ,MFC and WIC and I would
I'm developing a face recognition login application in MFC. How can I run my
I am new to Visual Studio 2008 (.NET Framework 3.5) and am Developing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.