home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!yale.edu!spool.mu.edu!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Subject: Re: Finding the installed colormap
- Message-ID: <1992Sep4.100336.19689@thunder.mcrcim.mcgill.edu>
- Organization: McGill Research Centre for Intelligent Machines
- References: <BtvC14.K0t@news.cso.uiuc.edu>
- Date: Fri, 4 Sep 92 10:03:36 GMT
- Lines: 33
-
- In article <BtvC14.K0t@news.cso.uiuc.edu>, ebina@void.uiuc.edu (Eric Bina) writes:
-
- > How do I find out the currently installed colormap?
-
- Which one? There may be many.
-
- > I need this for a simple screen grabbing function I am doing. To
- > grab an arbitrary section of the root window I do an XGetImage() with
- > IncludeInferiors. The problems is that the colormap that is
- > installed at the time of the grab may not be the default colormap.
- > When I save this image to file, I want to save the proper colormap
- > with it.
-
- In that case, you don't want "the installed colormap"; you want to know
- what's actually in the hardware. X does not provide any way to find
- this out. Even in what is probably the simplest case, a normal 8-bit
- PseudoColor display with a single hardware colormap, knowing the
- installed colormap (in this case, "the" installed colormap) doesn't
- help, because X makes no promises about what's in the hardware cells
- corresponding to unallocated cells in the colormap.
-
- And what if the area selected contains windows of different visuals, or
- worse, of different depths?
-
- Now that I've just told you you can't do what you want for two
- different reasons, I'll tell you how to do what you want. Well, not
- really, but I'll tell you how to do what you asked for. It's called
- XListInstalledColormaps.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-