home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sun4nl!sun2.iend.wau.nl!metten.fenk.wau.nl!peter
- From: peter@fenk.wau.nl (Peter Barneveld)
- Subject: Grays with a B&W monitor compatibility problem
- Message-ID: <BxKA5L.1ws@fenk.wau.nl>
- Keywords: Gray scale, B&W, RGBColor, SetCPixel
- Organization: Dpt. of Physical and Colloid Chemistry, Wageningen University, NL
- Date: Wed, 11 Nov 1992 17:05:44 GMT
- Lines: 22
-
- Hi everyone,
-
- I am writing a program that draws a gray-scale image into a window based
- on a cGrafPort. I use SetCPixel(i-1,j-1,cPix) to draw the image pixel by
- pixel. cPix is and RGB color with red, green and blue equal to obtain
- gray (code base on RGBForeColor(cPix); MoveTo(i-1,j-1); Line(0,0); is
- equivalent). This works fine for color and gray-scale monitors, but
- fails with B&W monitors. With B&W monitors this procedure yields a
- complete black image. What I want, obviously, is that the "lower" half
- of the gray spectrum is represented as white and the upper half as black.
-
- Is it somehow possible to get this behaviour using a cGrafPort with a
- B&W monitor?
-
- If not, then a GrafPort can be used instead, but how do I know whether
- there is a color or a B&W monitor present? IM states that one should use
- a high level QD routine to obtain this info, but I can't find any.
-
- The program assumes running under System 7.0 or higher.
-
- Thanks in advance
- Peter
-