Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!bloom-beacon!POPEYE.NOSC.MIL!glasgow From: glasgow@POPEYE.NOSC.MIL (Michael Glasgow) Newsgroups: comp.windows.x Subject: Storing colors in the DefaultColormap Message-ID: <8912302146.AA03921@popeye.nosc.mil.sun.com> Date: 30 Dec 89 21:46:48 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 27 I have an application that displays a digital image in a window. The image is stored as a bunch of eight bit values that are indexes into a predefined color map. Each image uses only the last 216 colors of the colormap, leaving the first 40 colors to be used by the rest of the system. I can create an entire colormap, and store these colors in the colormap at the given locations with XStoreColors(), and then use XInstallColormap() to get the colormap to change. This will cause any windows which have used XAllocColor() to change colors. I don't want this to happen. Another way I could get the colors that I need is to use XAllocColor on all 216 colors, and do a translation as I read in the data to its proper pixel value. The problem with this is that it is slow for a 1500x1500 or larger image. Is there a way to store a given color cell definition in a specific location in the colormap? Also, is there a way to Query the colormap, so that I can find out how many colormap cells are available? Any response would be greatly appreciated. Michael Glasgow glasgow@popeye.nosc.mil