Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rphroy!caen!uwm.edu!bionet!agate!usenet.ins.cwru.edu!ysub!psuvm!cxt105 From: CXT105@psuvm.psu.edu (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Palette Manager question Message-ID: <91106.132819CXT105@psuvm.psu.edu> Date: 16 Apr 91 17:28:19 GMT Organization: Penn State University Lines: 30 I've got a bizarre little application with a bizarre little problem. Basically what I'm doing is twiddling bits in an off-screen CGrafPort directly and then blasting the result into a window with CopyBits. So far, so good; the CopyBits works, etc. However, I've got a problem with the Palette Manager. I want to use (say) n shades of grey in my window; unfortunately, for rather exotic reasons it is essential that these shades of grey be represented in the offscreen CGrafPort by the pixel values 0 through n-1. I can't seem to get the Palette Manger to do what I want it to. What I *want* is to set up a palette with my desired colors in it, and have those colors appear when I CopyBits the image into the window. What's happening is that I'm getting the first n colors in the default system palette, not my greyscales. If I use the Color Manager to SetEntries() on the first n colors, then I get exactly what I want; unfortunately, I'm not sure how to go about saving and restoring the original color map if I do that -- it gets *very* ugly on the rest of the screen! Do I have to (somehow) associate the palette I want to use with the CGrafPort as well as with the Window? Do I have to muck about with CLUT's? How should I go about resetting the original palette/CLUT/whatever when my application quits? Etc.... ------- Christopher Tate | | "An operating system, like a government, cxt105@psuvm.psu.edu | performs no useful function by itself." {...}!psuvax1!psuvm.bitnet!cxt105 | cxt105@psuvm.bitnet |