Palette info for BITMAP resources -- 256-color video 
Author Message
 Palette info for BITMAP resources -- 256-color video

I inherited an MFC project in which the user displays bitmaps that are
stored in resources.  That is, the .RC file contains lines of:

name BITMAP DISCARDABLE "filename.bmp"

The bmp files are all 256-color.

The bitmap resource is loaded into a CBitmap object which is then
StretchBlt'ed to the screen device context.

It all works fine unless I try to run on a 256-color system.  Then the
colors look awful.

My research indicates that to properly draw a bitmap in a 256-color
system, I need to perform a RealizePalette call, which requires that I
have the palette for the bitmap.  But there is no palette in sight, as
far as I can see.

My questions are:

What's the right way to do this?  Is it even possible, as long as the
bitmaps are stored as resources?

Is the palette available from a bitmap resource?  Did it survive the
conversion from BMP file to bitmap?  Is this documented anywhere?

Would it have been better to start with a 24-bit or 32-bit color BMP?

Thanks in advance for any help.

- Michael Bate



Sun, 01 Jun 2003 11:30:12 GMT  
 Palette info for BITMAP resources -- 256-color video
i've found a lot of info about bitmap at www.codeguru.com



Quote:
> I inherited an MFC project in which the user displays bitmaps that are
> stored in resources.  That is, the .RC file contains lines of:

> name BITMAP DISCARDABLE "filename.bmp"

> The bmp files are all 256-color.

> The bitmap resource is loaded into a CBitmap object which is then
> StretchBlt'ed to the screen device context.

> It all works fine unless I try to run on a 256-color system.  Then the
> colors look awful.

> My research indicates that to properly draw a bitmap in a 256-color
> system, I need to perform a RealizePalette call, which requires that I
> have the palette for the bitmap.  But there is no palette in sight, as
> far as I can see.

> My questions are:

> What's the right way to do this?  Is it even possible, as long as the
> bitmaps are stored as resources?

> Is the palette available from a bitmap resource?  Did it survive the
> conversion from BMP file to bitmap?  Is this documented anywhere?

> Would it have been better to start with a 24-bit or 32-bit color BMP?

> Thanks in advance for any help.

> - Michael Bate



Sun, 01 Jun 2003 16:01:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 256 color Bitmap/palette question

2. 256 color bitmap, CDialog - palette problem

3. 256 color Bitmap/palette question

4. displaying 256 color bitmap in 256 color mode

5. how to insert 256 color bitmap in resource

6. 256 color bitmap resource from a dialog?

7. Resources - 256 colors bitmap

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

9. Changing default palette on 256 color VGA driver

10. 256 color palette question

11. CButton, Palette and 256 color display

12. TC++ 256 color palette

 

 
Powered by phpBB® Forum Software