Board index » cppbuilder » Changing from High/True Colour to 256 colour

Changing from High/True Colour to 256 colour

I'm not sure which group best suits this message so I've sent it to the 2 I
think appropriate, I have certain software that needs 256 colour mode and
certain software that needs High/True colour.  Is there an API call or some
other way of changing between these modes with software - I would like to
choose any mode i.e. 16-bit, 256-colour, High Colour, True Colour - if it is
possible?

Alex Brett
alex_br...@hotmail.com
--

 

Re:Changing from High/True Colour to 256 colour


ChangeDisplaySettings.

Feng Yuan

Re:Changing from High/True Colour to 256 colour


Try this it was found in one of the news groups and werks perfectly.  If i
knew the person who posted it i would give them credit but here it is

#include <winuser.h>

int scrHeight, scrWidth, scrBPP;

        DEVMODE dm;
        ZeroMemory(&dm,sizeof(dm));
        dm.dmSize=sizeof(dm);
        dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
        dm.dmPelsWidth = scrWidth;
        dm.dmPelsHeight = scrHeight;
        dm.dmBitsPerPel = scrBPP;
        LONG res = ChangeDisplaySettingsA(&dm,CDS_TEST);
        if (res!=0) return; // error
        ChangeDisplaySettingsA(&dm,CDS_FULLSCREEN | CDS_UPDATEREGISTRY |
CDS_SET_PRIMARY);

and set set scrHeight, scrWidth, scrBPP to whatever values you need

ex.
scrHeight = 480;
scrWidth = 640;
scrBPP = 8; //256 colors

(This code was modified from original post.)

Hope this helps.

Quote
"Alex Brett" <alex_br...@hotmail.com> wrote in message

news:38fb56c7@dnews...
Quote
> I'm not sure which group best suits this message so I've sent it to the 2
I
> think appropriate, I have certain software that needs 256 colour mode and
> certain software that needs High/True colour.  Is there an API call or
some
> other way of changing between these modes with software - I would like to
> choose any mode i.e. 16-bit, 256-colour, High Colour, True Colour - if it
is
> possible?

> Alex Brett
> alex_br...@hotmail.com
> --

Re:Changing from High/True Colour to 256 colour


Thanks, if 8 is 256 colour then what are the numbers for high and true
colour, are they 16 and 32 or something totally different?

Thanks again,
Alex Brett
alex_br...@hotmail.com

Quote
<Odin_...@yahoo.com> wrote in message news:38fbea11@dnews...
> Try this it was found in one of the news groups and werks perfectly.  If i
> knew the person who posted it i would give them credit but here it is

> #include <winuser.h>

> int scrHeight, scrWidth, scrBPP;

>         DEVMODE dm;
>         ZeroMemory(&dm,sizeof(dm));
>         dm.dmSize=sizeof(dm);
>         dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
>         dm.dmPelsWidth = scrWidth;
>         dm.dmPelsHeight = scrHeight;
>         dm.dmBitsPerPel = scrBPP;
>         LONG res = ChangeDisplaySettingsA(&dm,CDS_TEST);
>         if (res!=0) return; // error
>         ChangeDisplaySettingsA(&dm,CDS_FULLSCREEN | CDS_UPDATEREGISTRY |
> CDS_SET_PRIMARY);

> and set set scrHeight, scrWidth, scrBPP to whatever values you need

> ex.
> scrHeight = 480;
> scrWidth = 640;
> scrBPP = 8; file://256 colors

> (This code was modified from original post.)

> Hope this helps.

> "Alex Brett" <alex_br...@hotmail.com> wrote in message
> news:38fb56c7@dnews...
> > I'm not sure which group best suits this message so I've sent it to the
2
> I
> > think appropriate, I have certain software that needs 256 colour mode
and
> > certain software that needs High/True colour.  Is there an API call or
> some
> > other way of changing between these modes with software - I would like
to
> > choose any mode i.e. 16-bit, 256-colour, High Colour, True Colour - if
it
> is
> > possible?

> > Alex Brett
> > alex_br...@hotmail.com
> > --

Re:Changing from High/True Colour to 256 colour


Quote
"Alex Brett" <alex_br...@hotmail.com> wrote in message

news:38fc2b15@dnews...

Quote
> Thanks, if 8 is 256 colour then what are the numbers for high and true
> colour, are they 16 and 32 or something totally different?

16-bit and 32-bit color are somewhat confusing.

With 8-bit color, each "pixel" is an index into a palette table.

With high color (15-/16-bit color) or true color (24-/32-bit color),
each pixel contains complete color information.

24-bit color is perhaps the easiest to explain:  each pixel contains
8-bits of red, 8-bits of green and 8-bits of blue.  Since each 8-bit
value can vary from 0..255, you have 256*256*256 = 16,777,216
colors (at least in theory).

32-bit color is 24-bit color with an extra 8-bits.  These extra
8-bits are sometimes called the "alpha" channel and can
be used for "alpha blending" where the alpha channel
has a pixel weight.  But, there really isn't any more
color information in a 32-bit color pixel than a 24 bit
color pixel.

15-bit color has 5-bits of red, 5-bits of green and 5-bits of
blue packed into a 16-bit field.  The extra bit here is also
sometimes called the "alpha" channel but is of little
practical value.

16-bit color has 5-bits of red, 6-bits of green and 5-bits
of blue.  An extra bit is allowed for more variations of
green since the eye is more sensitive to greens and
least sensitive to blues.  Many folks claim they have
16-bit color when the just have 15-color stored in
a 16-bit quantity.

--
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

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

Other Threads