How to chang display from 256 colors to High Color or True Color

How to chang display from 256 colors to High Color or True Color

Post by Robert Lockwoo » Tue, 17 Oct 2000 04:00:00



My application runs on a couple of NT 4 machines that are often in 246 color
mode. (It took me a while to figure out why it would sometimes display
correctly but not at other times. I would like my ap to detect this and
change the mode to high color or true color (if available) when it loads.
How do I do this.  Mostly my aps run on NT or W2K but I would like this to
work on 98 or 95.

Thanks

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by Feng Yua » Wed, 18 Oct 2000 04:00:00


Use EnumDisplaySettings to enumerate supported settings. Some display card
does not support 24-bpp display mode, but supports 32-bpp display modes.

Use ChangeDisplaySettings to change.

Feng Yuan  ( for the GDI to read, check www.fengyuan.com )

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by Robert Lockwoo » Wed, 18 Oct 2000 04:00:00


Thanks

Bob


Quote:> Use EnumDisplaySettings to enumerate supported settings. Some display card
> does not support 24-bpp display mode, but supports 32-bpp display modes.

> Use ChangeDisplaySettings to change.

> Feng Yuan  ( for the GDI to read, check www.fengyuan.com )

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by Robert Lockwoo » Wed, 18 Oct 2000 04:00:00


I tried EnumDisplaySettings.  The help says:
When you call EnumDisplaySettings with iModeNum set to zero, the operating
system initializes and caches information about the display device. When you
call EnumDisplaySettings with iModeNum set to a non-zero value, the function
returns the information that was cached the last time the function was
called with iModeNum set to zero.  I guess what that means is that it
enumerate all the graphics modes of which it is capable.

I ran a test loop incrementing iModNum until EnumDisplaySettings returned
false.  iModeNum was 98 at that point.  I have a laptop with 8Mb of memory.
The display is 1024x768 and supports 32 bit color.

What's happening in my ap is that it runs on some machines that are set to
8bit color by another program.  My program does not display correctly in
this mode so I want to save the current mode, in this case, and increase the
display to high color.  At the very least I want to alert the user so the
display can be changed. When the program is quit I want to restore the
display if it has been changed.  I know that I need a reference book so
thanks for the tip.

Bob


Quote:> Use EnumDisplaySettings to enumerate supported settings. Some display card
> does not support 24-bpp display mode, but supports 32-bpp display modes.

> Use ChangeDisplaySettings to change.

> Feng Yuan  ( for the GDI to read, check www.fengyuan.com )

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by dbulme » Fri, 20 Oct 2000 04:00:00


Robert,

www.bcbfaq.com has a FAQ on detecting screen res.
Might be useful for you.

Dave B.

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by Robert Lockwoo » Fri, 20 Oct 2000 04:00:00


Thanks!

> Robert,

> www.bcbfaq.com has a FAQ on detecting screen res.
> Might be useful for you.

> Dave B.

 
 
 

How to chang display from 256 colors to High Color or True Color

Post by dbulme » Sat, 21 Oct 2000 04:00:00


Sorry - link should be www.bcbdev.com
 
 
 

1. Bitmap: True/High-color to 256 color

Alex:


I'll try.

Is the main goal here to reduce the size of the bitmap?   If so, you
might want to investigate JPEGs with a fairly high quality factor --
say 75 or more. With screen shots it's likely you need a fairly
high "quality" to avoid artifacts along lines.  JPEGs do a good
job in maintaining colors (especially for > 256 colors) and give
quite a bit of compression.

For 256 colors you may want to investigate GIFs and try Anders
Melanders TGIFImage at www.melander.dk/delphi/gifimage .
GIFs may do better if you have lines (like in a screen shot) and
more limited colors.   GIFs will give you 256 colors and file
compression.

If you really want a pf8bit bitmap from a pf24bit bitmap, that's
a bit complicated.  The process involves coming up with an
appropriate palette, which may be difficult since some images
can have thousands of colors and you want the best 236 to
display your image.  (In 256 color mode you must limit your
selection to 236 colors sinces Windows reserves 20 for
display of icons, buttons, panels, etc.  In high color or
true color display modes, you can use all 256 colors for
display, but the results are a bit unpredictable in 256 color
mode.)

My ShowDemoOne Lab Reports shows how to get the
needed palette for a pf24bit bitmap that's good enough
to just display a pf24bit bitmap in 256 color mode.
However, if you want to create a pf8bit bitmap, I've never
finished the final step of taking each pf24bit RGB pixell
and find the right index in the palette table for the pf8bit
scanline.

There is C++ code for converting a pf24bit bitmap to a
pf8bit bitmap on my (non-Delphi) color page.
Look for "Octree Color Quantization" and the link to the
article by I. Ashdown in the C/C++ User's Journal.  There's
complete code there but in C++.  Find the link in Section B of
http://www.efg2.com/Lab/Library/Color.htm

Best wishes to Brazil,

--
efg


Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

2. Win 95 Triangulation Software

3. display non dithering colors for 256 color display

4. Call for Papers - Visual Data Exploration and Analysis VI

5. true color to 256 color

6. How can I modify a bmp file?

7. How to change True color pixel to 256 color pixel, @Thanks

8. Help Writing Plugin

9. Colors: 256 vs High Color

10. 256 color images in high color mode

11. Displaying 256 color GIFs on 16 color device

12. High Color, True Color

13. play 256 colors FLC on 256 color bmp ???