256 Color Bitmaps in CImageList use 16 default colors 
Author Message
 256 Color Bitmaps in CImageList use 16 default colors

I have been struggling with this problem for a while.

 I have a set of 256 color bitmap (using the default halftone palette),
which display fine in code where I explicitly load their palettes, select it
into the DC, and bitblt them to the screen.

However, when I load the same bitmaps into a CImageList, and use them in a
CTreeView, the colors are mapped to the 16 default colors.

I am creating the CImageList with ILC_COLOR8, and loading the images
by using CBitmap.Load() and CImageList.Add().

(Running NT4.0, SP3, 256 colors - problem is resolution independent).

thanks

ronald



Sun, 10 Dec 2000 03:00:00 GMT  
 256 Color Bitmaps in CImageList use 16 default colors

Quote:

>I have been struggling with this problem for a while.

> I have a set of 256 color bitmap (using the default halftone palette),
>which display fine in code where I explicitly load their palettes, select
it
>into the DC, and bitblt them to the screen.

>However, when I load the same bitmaps into a CImageList, and use them in a
>CTreeView, the colors are mapped to the 16 default colors.

>I am creating the CImageList with ILC_COLOR8, and loading the images
>by using CBitmap.Load() and CImageList.Add().

2 thoughts (I do not use resource bitmaps much)

What about ILC_PALETTE and

I think CBitmap::LoadBitmap doesn't load the palette, try ::LoadImage(...)

cU
--

   http://djuga.home.ml.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retriever 1.1 is out: http://retriever.home.ml.org

Shareware image viewer, thumbnailer & database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 11 Dec 2000 03:00:00 GMT  
 256 Color Bitmaps in CImageList use 16 default colors

Quote:


> >I have been struggling with this problem for a while.

> > I have a set of 256 color bitmap (using the default halftone palette),
> >which display fine in code where I explicitly load their palettes, select
> it
> >into the DC, and bitblt them to the screen.

> >However, when I load the same bitmaps into a CImageList, and use them in a
> >CTreeView, the colors are mapped to the 16 default colors.

> >I am creating the CImageList with ILC_COLOR8, and loading the images
> >by using CBitmap.Load() and CImageList.Add().

> 2 thoughts (I do not use resource bitmaps much)

this works: (okay, it's not MFC, but pure win32, but can easily be
rewritten)

hScreens = ImageList_Create(100, 70, ILC_COLOR8, 0, 999);
ASSERT(hScreens);
hScrBM = LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(BMP_SCREENS256),        IMAGE_BITMAP, 0, 0,
LR_LOADTRANSPARENT);
ImageList_Add(hScreens, hScrBM, NULL);

--

|      |  Abyss Online          - http://abyss.moving-people.net
| (o)(o)  Pyrodex               - http://abyss.moving-people.net/pyrodex
C      _) THX Sound System 2.3d - http://abyss.moving-people.net/thx
 | ,___|  DemoScene Ad Exchange - http://abyss.moving-people.net/dadx
 |   /    System 16 Emu DirectX -
http://abyss.moving-people.net/s16w32.html



Mon, 11 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Detecting Color Pallete ( 16 colors , or 256 colors, or Hi color) URGENT

2. 256 color bitmaps get remapped with 16 color palette when using 256 color display?

3. displaying 256 color bitmaps when screen is in 256 color mode

4. showing 256 color bitmaps with display settings set to 256 colors

5. Need help to select a 256 color bitmap into 16 bit color DC

6. Help: 256 color icons displayed in 16 colors

7. Why 256 color image is displayed as 16 color image

8. How can i make SetImageList(CImageList) take over 16 color bitmaps

9. Using CImageList with 256 colors bitmap

10. 8 bit (256 color) bitmaps vs 24 bit bitmaps

11. displaying 256 color bitmap in 256 color mode

12. Transparent color using bitblt (256 color)?

 

 
Powered by phpBB® Forum Software