Path: utzoo!attcan!uunet!husc6!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: Visual help needed.. Multi-plane as a Monochrome Message-ID: <8809131605.AA01736@EXPO.LCS.MIT.EDU> Date: 13 Sep 88 16:05:33 GMT References: <139@tityus.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 41 If the display only supports depth 8 visuals, then you probably won't be able to create any depth 1 windows. You'll need to ask specific questions. Some things to watch out for, though: o avoid any GX function other than GXcopy unless you really know what you're doing; one exception is inverting between two colors (in simple menus, for example): set the foreground value in the GC to be the xor of the two colors and set the function to be GXxor. Doing a filled rectangle over an area made of up of those two colors will appear to toggle them. But, if any other other colors get in the way you'll get trash. o be cautious of thing that requires setting the planemask to any value besides AllPlanes; unless you have allocated planes, you're probably doing something wrong. o stipples are single plane; tiles (backgrounds, borders, etc.) are multi-plane. o when creating a pixmap from single plane (e.g. "bitmap") data, use XCreatePixmapFromBitmapData; this will be easier in R3 as there will a library of miscellaneous utility routines that will include a call for reading bitmap data from files. Until then: o if you have a bitmap (i.e. single-plane pixmap) that you need to turn into a two color, multi-plane pixmap, create a scratch GC with foreground and background set to the appropriate colors and graphics_exposures set to False; create a pixmap of the appropriate size using XCreatePixmap; then, do an XCopyPlane from the bitmap to the pixmap and free the scratch GC. o make no assumptions about what value BlackPixel and WhitePixel have. Obviously, there are exceptions to each of the above. Caveat hactor. Jim Fulton MIT X Consortium