home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / 16181 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.8 KB  |  43 lines

  1. Newsgroups: comp.windows.x
  2. 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
  3. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  4. Subject: Re: Finding the installed colormap
  5. Message-ID: <1992Sep4.100336.19689@thunder.mcrcim.mcgill.edu>
  6. Organization: McGill Research Centre for Intelligent Machines
  7. References: <BtvC14.K0t@news.cso.uiuc.edu>
  8. Date: Fri, 4 Sep 92 10:03:36 GMT
  9. Lines: 33
  10.  
  11. In article <BtvC14.K0t@news.cso.uiuc.edu>, ebina@void.uiuc.edu (Eric Bina) writes:
  12.  
  13. > How do I find out the currently installed colormap?
  14.  
  15. Which one?  There may be many.
  16.  
  17. > I need this for a simple screen grabbing function I am doing.  To
  18. > grab an arbitrary section of the root window I do an XGetImage() with
  19. > IncludeInferiors.  The problems is that the colormap that is
  20. > installed at the time of the grab may not be the default colormap.
  21. > When I save this image to file, I want to save the proper colormap
  22. > with it.
  23.  
  24. In that case, you don't want "the installed colormap"; you want to know
  25. what's actually in the hardware.  X does not provide any way to find
  26. this out.  Even in what is probably the simplest case, a normal 8-bit
  27. PseudoColor display with a single hardware colormap, knowing the
  28. installed colormap (in this case, "the" installed colormap) doesn't
  29. help, because X makes no promises about what's in the hardware cells
  30. corresponding to unallocated cells in the colormap.
  31.  
  32. And what if the area selected contains windows of different visuals, or
  33. worse, of different depths?
  34.  
  35. Now that I've just told you you can't do what you want for two
  36. different reasons, I'll tell you how to do what you want.  Well, not
  37. really, but I'll tell you how to do what you asked for.  It's called
  38. XListInstalledColormaps.
  39.  
  40.                     der Mouse
  41.  
  42.                 mouse@larry.mcrcim.mcgill.edu
  43.