List Info

Thread: How to know how many colors a user can display on his screen?




How to know how many colors a user can display on his screen?
user name
2007-01-05 17:09:21

Chris

Try GetDeviceCaps (Windows, not Delphi). I know it works on Printers but I have
not tried it on a monitor. Here is sample code for a printer:

try

{BITSPIXEL determine the number of colours in the device}
nColourBits := GetDeviceCaps(Printer.Handle,BITSPIXEL);
Total_Colour_Shades := IntPowerInt(2,nColourBits);

{PLANES determine the number of colour planes}
nPlanes := GetDeviceCaps(Printer.Handle,PLANES);
Total_Colours := IntPowerInt(Total_Colour_Shades,nPlanes);

{If the number of colours < 3 then it is a black and white printer}
// You need to determine whether 3 is the correct changeover number
bColour := Total_Colours > 3;

except on EIntOverFlow do
bColour := true;
end;

Good luck and a Happy New Year,

Bobby Clarke

Chris Lab wrote:
&gt;
>
> Hello to all of you,
>
> I have this problem, we have many TImages (clear nice 24 bits pictures)
> components on a Form, but some of our clients have erros when they open
> the FORM cause they dont have a graphic card powerful enough to display
> all the colors.
&gt;
> Can anybody help me
>
> 1. at the FORMCREATE event, get the user max number of colors of his system
&gt; 2. Can you suggest a way to adapt the TImage so the colors would be
> reduced to that max number of colors and it would work for everyone.
>
> Thanks a lot.
>
> Christian
>
> [Non-text portions of this message have been removed]
>
>
>
>
> ----------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.4/615 - Release Date: 03/01/2007 13:34

__._,_.___
.

__,_._,___
How to know how many colors a user can display on his screen?
user name
2007-01-05 19:53:36

Good Morning!

Try the JEDI V3 unit JvComputerInfoEx. It has a LOT
of classes covering system info!

HTH...Dan'l

--- Bobby Clarke < bobbyclarke%40gmail.com">bobbyclarkegmail.com> wrote:

> Chris Lab wrote:
&gt; >
> >
> > Hello to all of you,
> >
> > I have this problem, we have many TImages (clear
&gt; nice 24 bits pictures)
> > components on a Form, but some of our clients have
> erros when they open
> > the FORM cause they dont have a graphic card
> powerful enough to display
> > all the colors.
&gt; >
> > Can anybody help me
> >
> > 1. at the FORMCREATE event, get the user max
> number of colors of his system
&gt; > 2. Can you suggest a way to adapt the TImage so
> the colors would be
> > reduced to that max number of colors and it would
>; work for everyone.
> >
> > Thanks a lot.
> >
> > Christian
> >
> > [Non-text portions of this message have been
> removed]
> >

____________________________________
Every day is a Great day, but
some days are GREATER than others!

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )