Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!stroyan From: stroyan@hpfcdc.HP.COM (Mike Stroyan) Newsgroups: comp.windows.x Subject: Re: Toolkit graphics Message-ID: <6910009@hpfcdc.HP.COM> Date: 25 May 89 02:37:28 GMT References: <1901@wasatch.utah.edu> Organization: HP Ft. Collins, Co. Lines: 25 > Another question. How do I determine if a machine is monochrome or color? > I thought I could determine it by examining the depth of an open screen. But > it always returns 8, even on a monochrome machine. What am I missing? > > Mark L. Lindsey You are probably missing release 6.5 of the HP X11 server. :-) Release 6.2 of X11 on HP 300s reported depth 8 on monochrome displays, reflecting the byte-per-pixel layout of the framebuffer. The depth is reported as the number of significant bits per pixel in release 6.5 of X11. A common way to get around it is to check DisplayCells() for more than two cells. The best way to check for a monochrome "machine" is to examine the visual class of the window you are rendering to. A server may support several visuals for a single screen. You can find out what visuals are available by using XGetVisualInfo. You can find the visual of a window by calling XGetWindowAttributes. The possible visual classes are StaticGray, GrayScale, StaticColor, PseudoColor, TrueColor, and DirectColor. The StaticGray and GrayScale classes are monochrome. The Xlib documentation includes a description of the properties of each visual class. Mike Stroyan, stroyan@hpfcla.hp.com