Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!samsung!emory!mephisto!eedsp!markov!eric From: eric@markov.eedsp.gatech.edu (Eric Hyche) Newsgroups: comp.windows.x Subject: How do obtain and/or set a grayscale colormap? Keywords: colormap,grayscale Message-ID: <1151@eedsp.eedsp.gatech.edu> Date: 7 Sep 90 19:05:37 GMT Sender: news@eedsp.eedsp.gatech.edu Reply-To: eric@markov.eedsp.gatech.edu (Eric Hyche) Organization: Georgia Institute of Technology Lines: 18 I am writing an X-Windows application to manipulate grayscale medical images. I would like to set the colormap for the window/screen to a grayscale colormap at the beginning of the application to save time. However, I cannot seem to set or obtain the grayscale colormap. Here's what I've tried: 1) XCreateColormap() - and then use XAllocColor to set the color cells. Problem: the colormap returned by XCreateColormap will not let anything be allocated to it. And yes, I did set AllocAll, not AllocNone. 2) XGetRGBColormaps() - to try to return the standard RGB_GRAY_MAP. Keep getting a segmentation error. Can anyone help or direct me to an example of how this is done? Eric Hyche Georgia Tech, School of Electrical Engineering, Atlanta, GA 30332 USENET: ...!{allegra,hplabs,ihnp4,ulysses}!gatech!gt-eedsp!eric INTERNET: eric@medinfo.gatech.edu