Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!kam From: kam@hpcvlx.HP.COM (Keith Marchington) Newsgroups: comp.windows.x Subject: Re: Is The Screen Color? Message-ID: <100920083@hpcvlx.HP.COM> Date: 27 Jun 89 20:33:43 GMT References: <18700@paris.ics.uci.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 37 / hpcvlx:comp.windows.x / dbainbri@ics.uci.edu (David Bainbridge) / 1:52 pm Jun 25, 1989 / > A while back someone asked about how to determine if the screen was > color or black and white. I found this in a book I have by O'Reilly and > Associates. > > #include < "Standard X Includes" > > > int depth; > > "Open Display, and get default screen" > > depth = DisplayPlanes( display, screen ); > > if ( depth == 1 ) > "Screen is monochrome" > else > "Screen is color" > > I haven't tested this, but I hope it works, I plan to use it. > >+---------------------------------------+-------------------------------------+ >| | | >| University of California, Irvine | dbainbri@ics.uci.edu | >| | | >+---------------------------------------+-------------------------------------+ No. Definitely not. On one of our tops, we implement a set of overlay planes as a potential screen. The overlays are two planes deep, but the visual is StaticGray, not color. The only way to assure that you are using a color visual is to check all of the available visuals of the screen (we also have another top that offers as many as three different visuals) and select one from the set of color visuals: StaticColor, PseudoColor, DirectColor, and TrueColor. Keith Marchington Hewlett-Packard