Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!uunet!microsoft!kensy From: kensy@microsoft.UUCP (Ken SYKES) Newsgroups: comp.windows.ms.programmer Subject: Re: 236 color GIF's on Windows? 20 more colors, please! Keywords: GIF BMP METAFILE VGA Message-ID: <58864@microsoft.UUCP> Date: 7 Nov 90 00:19:53 GMT References: <1990Nov5.102146.27535@agate.berkeley.edu> Reply-To: kensy@microsoft.UUCP (Ken SYKES) Organization: Microsoft Corp., Redmond WA Lines: 36 In article <1990Nov5.102146.27535@agate.berkeley.edu> c60c-3fz@e260-3f.berkeley.edu (In Sik Rhee) writes: >After hacking away for 13 straight hours today, I finished my GifImp code >Bitmap) which, in turn, becomes a Metafile... now, the problem I face is >that with a 256 color GIF image, I create a logical palette... but when >I select and realize it, windows will not let me take precedence over its >20 primary colors in the system palette... so essentially, it will only >give me 236 color indices... (or am I doing something wrong?) so for now, >I am setting the last 20 colors the value of the 236th color (usually works >out since most 256 color vga shots are digitized pics which have very close >color values for closely mapped values) and you really cant tell the >difference unless you looked for it. What you are doing is right except I don't understand what you mean by "filling the last 20 colors..." since the palette manager would map all those duplicate colors to the same system palette index anyways. > >But I'm a purist, so I want to know how I can incorporate all my 256 colors >(or as many as possible) for my application. > If you are a true purist then you should accept your current solution. The (should I say A) problem with the Mac is that the entire screen changes colors when you display a 256 color image. Some of the results can be quite disgusting looking. Windows reserves these twenty colors so it can guarantee accurate reproduction of dithers and standard solids. Now if you REALLY want all 256 colors you can get closer (254 of them) by using the SetSystemPaletteUse function to grab the entire palette. Windows will still keep two entries for black and white (necessary for proper operation.) See the Guide to Programming about how to use this function properly. Use of this function comes with certian responsibilities, the primary one being you will remember the system palette contents when you are activated and restore the system palette when deactivated. This ensures that other windows will be messed up ONLY when your app is in the foreground. Also keep in mind people may not like you making the rest of their screen ugly so have this as a menu option.