Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!apple!coherent!dplatt From: dplatt@coherent.com (Dave Platt) Newsgroups: comp.sys.mac.programmer Subject: Re: PaletteManager vs. CopyBits (long; gurus only) Keywords: Palette Manager, CopyBits, Custom Search Procedure Message-ID: <47531@improper.coherent.com> Date: 23 Feb 90 00:46:15 GMT References: <10713@zodiac.ADS.COM> <1919@wrgate.WR.TEK.COM> Reply-To: dplatt@coherent.com (Dave Platt) Distribution: na Organization: Coherent Thought Inc., Palo Alto CA Lines: 37 In article <1919@wrgate.WR.TEK.COM> herbw@midas.WR.TEK.COM (Herb Weiner) writes: > In Article <10713@zodiac.ADS.COM> jdevries@zodiac.ADS.COM (Jeff De Vries) writes: > > > 3) How do you use CopyBits with an animated palette? > > In my opinion, Apple screwed up badly on this one. To make it work, you need > to implement a custom search procedure. If your window is active (you have > received an Activate Event, but have not received a deactivate event), You > need to install it immediately before you do your CopyBits, and you need to > remove it immediately after your CopyBits. (If you do all this, you do not > need to worry about the client ID, because your CopyBits is the only possible > client.) There's a much better way to do this if you have 32-bit Color QuickDraw installed. You can tag your off-screen PixMap so that [a] it uses the same palette as the window, and [b] the values in the PixMap represent palette indices, NOT colortable indices. When you CopyBits() the off-screen PixMap to the screen, CopyBits performs a palette-index-to colortable-index lookup, and stores the correct [animated or non- animated] color into the screen PixMap. This lookup takes the place of the usual colortable-index->RGBcolor->screen-colortable-index search... which will not handle animated colors properly. This feature works very well even if your destination window touches multiple screens. It's VERY hard to CopyBits() animated colors to a multi-screen window with any other technique... and every other technique I've tried or encountered is UGLY! > Refer to Inside Mac Volume V for more info on all this. Also the 32-bit Color QuickDraw documentation, available from APDA or on Phil&Dave's Excellent but Generally Unavailable CD-ROM. -- Dave Platt VOICE: (415) 493-8805 UUCP: ...!{ames,apple,uunet}!coherent!dplatt DOMAIN: dplatt@coherent.com INTERNET: coherent!dplatt@ames.arpa, ...@uunet.uu.net USNAIL: Coherent Thought Inc. 3350 West Bayshore #205 Palo Alto CA 94303