home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18276 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.4 KB  |  33 lines

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