Article View: comp.sys.mac
Article #19732Re: How Many Colors?
From: fry
Date: Sun, 04 Oct 1987 01:14
Date: Sun, 04 Oct 1987 01:14
24 lines
1588 bytes
1588 bytes
In article <2927@husc6.UUCP> singer@endor.UUCP (Richard Siegel) writes:
>How does one tell how many bits per pixel are set in the Control Panel?
>I know that it's possible, because I see demos that refuse to run
>unless 8 bits per pixel (256 colors) are set up -- they display a
>message saying "8 bits per pixel required" if it isn't set up.
Let screenRect be a rectangle that defines the area you want
to know the pixel depth of. If you only have one monitor
attached then screenRect can be screenBits.bounds, but you may
want to be more specific for multiple monitors. If you just
want to know the greatest depth of any monitor attached (which
is the normal thing to do) let screenRect be the rectangle
enclosing the GrayRgn, the desktop even for multiple screen
setups.
Once you've got screenRect figured out, call
maxdev = GetMaxDevice(&screenRect);
/* returns gDevice handle of deepest device */
and then
theDepth = (**((**maxdev).gdPMap)).pixelSize;
will give you the bits per pixel of that screen.
Technical Details
Message-ID:
<2928@husc6.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!husc6!huma1!fryReferences:
<2927@husc6.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!husc6!huma1!fry From: fry@huma1.UUCP Newsgroups: comp.sys.mac Subject: Re: How Many Colors? Message-ID: <2928@husc6.UUCP> Date: Sat, 3-Oct-87 21:14:10 EDT Article-I.D.: husc6.2928 Posted: Sat Oct 3 21:14:10 1987 Date-Received: Sun, 4-Oct-87 07:08:19 EDT References: <2927@husc6.UUCP> Sender: news@husc6.UUCP Reply-To: fry@huma1.UUCP (David Fry) Organization: Harvard Math Department Lines: 24 Keywords: Color, QuickDraw, Depth