Board index » delphi » 16-Color Bitmap on 256 Color Screen

16-Color Bitmap on 256 Color Screen

    My application runs fine on my computer
where the video card is set for 64k colors,
but when I run it on my friend's computer
(which is set for 256 colors) the bitmaps
don't display properly on her monitor.
    I thought they would map OK (since they
are only 16 color-bitmaps) in a 256-color setup.
    Does anyone know how to read the
bitmap's pallette and reset the screen using
that pallette? Is this the right thing to do?
    I have looked through all the Delphi books
at the Computer Literacy bookstore, but none
of them go into detail regarding pallettes.
    Also, I heard there was a bug in Delphi
regarding 256 color bitmaps.
    Does anyone know how to do this, where to
look, or a 3rd party software that will handle this
problem?
    Thanks for any help.
 

Re:16-Color Bitmap on 256 Color Screen


I had a similar problem a while ago, so I just made sure that my 256 bmp
had the "basic" Windows colors in its palette.. This fixed it.

Obviously it did not quite look nice under a 16 color system.

Re:16-Color Bitmap on 256 Color Screen


On 2 Apr 1996 16:12:45 GMT, fairbroth...@smart.net wrote:

Quote
>    My application runs fine on my computer
>where the video card is set for 64k colors,
>but when I run it on my friend's computer
>(which is set for 256 colors) the bitmaps
>don't display properly on her monitor.
>    I thought they would map OK (since they
>are only 16 color-bitmaps) in a 256-color setup.
>    Does anyone know how to read the
>bitmap's pallette and reset the screen using
>that pallette? Is this the right thing to do?
>    I have looked through all the Delphi books
>at the Computer Literacy bookstore, but none
>of them go into detail regarding pallettes.
>    Also, I heard there was a bug in Delphi
>regarding 256 color bitmaps.
>    Does anyone know how to do this, where to
>look, or a 3rd party software that will handle this
>problem?

Palettes are one of the least understood aspects of Windows
programming. Even books like "Advanced Windows Programming," which
focuses on graphics, does not discuss palettes to any depth. Hidden
somewhere at Microsoft's FTP and Web sites are some help files that
describe palettes fairly well. They are the best source of information
on using palettes in Windows that I have ever found.

After studying palettes in general, one can then try to learn what
Delphi does with palettes, which is quite a bit, actually. In most
cases, Delphi does the right thing for you, without your needing to
muck about with selecting and realizing palettes.  Just make sure that
Delphi knows about your palette. (If you create a bitmap, then set the
bitmap's Palette property. If you create a control, override the
GetPalette method. See the on-line help files for details.)

When copying bitmaps, Delphi does not provide extra help, but leaves
it up to you. After studying the Microsoft palette information,
however, you will probably find it relatively simple to determine what
to do and how to do it.
--
Ray Lischner                              li...@tempest-sw.com
Tempest Software, Corvallis, Oregon, USA  http://www.tempest-sw.com

Other Threads