Link to home
Start Free TrialLog in
Avatar of stzclaus
stzclaus

asked on

256 color in CListCtrl

Hi,
I have CTreeCtrl within a dialog box and I want to use 256 color bitmaps that a stored in a CImageList. But everything I tried seemed
not to work. The Images are allways displayed  in gray.

Does anybody have a solution for this problem?

Thanx in advance,
 Tom

ASKER CERTIFIED SOLUTION
Avatar of motigust
motigust

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stzclaus
stzclaus

ASKER

Hi Moti,

Thank you for your answer. I've tried the code you gave me, but the bitmaps still appear in grayscale. I don't know exactly what else is wrong in my code.
Maybe you could help me with the following questions.
 How do I have to create the CImageList?
   I use: pMyImageList->Create(IDB_BLABLA,XX,Y,0)
   Maybe I should use pMyImageList->Create(x,x ILC_COLOR8,x,x) ??
   If I do so, do I have to Add every Bitmap I want to use? And how do I get the Bitmap? With the    same function you gave to me?

To what DC do I have to select the pallet?
 I tried  CClientDC myDC (this) and CClientDC myDC (NULL)
Is this wrong?

It would be great, if you could help me!

Many, many thanx in advance

Tom

Hi Moti!

It works!

I think the only problem was, that I used the wrong create-function for my CImageList.
I tried Create(x,x ILC_COLOR8,x,x), Add (IDB_IMAGEWHATSOEVER,xx ) and everything was fine. I didn't even had to create or add a pallete!

Anyway thank you for your troubles!

Tom