Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!voder!nsc!amdahl!JUTS!duts!rla20 From: rla20@duts.ccc.amdahl.com (Roger L Allen) Newsgroups: comp.sys.mac.programmer Subject: Palette Manager Woes...HELP! Message-ID: <3cR602lw02Cj01@JUTS.ccc.amdahl.com> Date: 5 Sep 90 21:15:35 GMT Sender: netnews@ccc.amdahl.com Reply-To: rla20@DUTS.ccc.amdahl.com (Roger Allen) Organization: Amdahl Corporation, Sunnyvale CA Lines: 44 Currently, I am working on my own Gif viewer. Mostly it is for my own personal enjoyment (agony) but if I can get this @#$%&* thing to work maybe I will make it a shareware product in an already packed market. ANYWAY, I am having a frustrating time with the palette manager and getting the correct colors on the screen. I've read the IM V PM Chapter, I've read all the c.s.m.p items that seemed relevant and I'm still confused. Does Apple have a document written so mere humans can understand the Palette Manager? So, here is what the program is doing: 1. Read in all the Gif header stuff and set up a Palette of all the colors that the image needs. (pmTolerant, 0 tolerance--I tried pmExplicit & pmAnimated to no avail) 2. Open up a window that the image will go into, attach the Palette and activate it. 3. Now, here is the tricky part... Read in the gif picture data and store it in an off-screen bitmap. BUT, each gif data byte is really an index into its own CLUT (the palette I spoke of), it is not a RGB value. So, Parts 1 & 2 went pretty well and I learned alot of interesting info along the way. But, Part 3 is causing me some grief. What I have tried: I tried just putting the raw data into the bitmap via the baseAddr ptr. --no luck here, even when I did a Palette2CMap for the window. The indexes seemed to change and the picture turned psychadelic(sp?) I also tried using PmSetForeColor(gifIndex) and then plotting the points as they are decoded--also no luck, I don't think the palette is loaded to this bitmap. So, as you can see I need help. Please email me and I will summarize and re-post if the answers are helpful. Thanks, Roger Allen rla20@DUTS.ccc.amdahl.com