Need help to select a 256 color bitmap into 16 bit color DC 
Author Message
 Need help to select a 256 color bitmap into 16 bit color DC

I need a little bit of help with the following code snippet.  I want to
create a 256 color bitmap and then draw onto the bitmap.   It works fine
if the screen is set to 256 colors, but SelectObject fails if I try to
select the newly created 256 color (8 bit) bitmap into the MemoryDC when
the screen is set to 16 bit colors.

I obviously missed something, but what?

Thanks in advance for any help



        BOOL b = Bitmap.CreateBitmap (,,1,8,NULL);

        CDC MemoryDC;
        MemoryDC.CreateCompatibleDC (NULL);
        CBitmap* pOldBitmap = (CBitmap*) MemoryDC.SelectObject (&Bitmap);

Fri, 07 Jun 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

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

2. Convert 16-bit bitmap to 256 colors?

3. Help: 256 color icons displayed in 16 colors

4. need an algorithm for converting 32-bit color to 16-bit color

5. displaying 256 color bitmap in 256 color mode

6. How does on test for 256 colors versus HighColor 16 Bit

7. 256 Color Bitmaps in CImageList use 16 default colors

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

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

10. Creating 8 bit bitmap from 16 bit DC

11. Converting a high-color bitmap to 16 colors

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


Powered by phpBB® Forum Software