Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ora!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: Does anyone have any working XGetRGBColormap code? Message-ID: <9103151149.AA11384@lightning.McRCIM.McGill.EDU> Date: 15 Mar 91 11:49:45 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 41 > I have code that needs the colourmap set up such that different > colours are on different bitplanes, so when gc.function == GXor, and > I plot something red over something blue, the resulting pixel will be > magenta. This is not always possible as phrased; you would have to be running on a server with colormap cell 0 either unallocated or containing black, for starters. However, if you use XAllocColorPlanes to ask for one pixel and three planes, fill your drawable with the pixel, and then set the planemask of the GC to the OR of the three planes, you will get much the same effect. > First, on what window should I be calling XGetRGBColourmaps? I'm > using the root and getting nada. Perhaps nobody has yet created any standard colormaps on that screen yet. (I believe the root *is* the correct window.) > Secondly, what is it giving me back? Is it placing a pointer to an > array of XStandardColormaps in whatever the third argument points to, > and mallocing the space for the array? That's how I'd interpret the description in the Xlib document. > If so, do I need to free it? I would guess so. The description doesn't explicitly say, which seems odd, but you should probably use XFree(). > Thirdly, if the property does not exist, how should I go about > creating it? Run xstdcmap :-) If you want to do it from your program, steal code from xstdcmap. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu