Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!umn-d-ub!rutgers!att!pegasus!ech From: ech@pegasus.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Hilite Mode Error Message-ID: <2635@pegasus.ATT.COM> Date: 27 Feb 89 15:37:32 GMT References: <4Y2CH4y00VE1MC7EUf@andrew.cmu.edu> Organization: AT&T ISL Middletown NJ USA Lines: 29 From article <4Y2CH4y00VE1MC7EUf@andrew.cmu.edu>, by rj0z+@andrew.cmu.edu (Robert George Johnston, Jr.): ... > Consider the following Pascal code: > begin > PenMode(srcXor); > BitClr(Ptr(HiliteMode, pHiliteBit)); > FrameRect(SomeRect); > end; > On a Macintosh equipped with Color QuickDraw, this procedure acts as > expected, by drawing a rectangle in the current hilite color. If the > screen is only one-bit-deep, it also acts accordingly by inverting the > frame of the rectangle. > Now, this same code, when executed on a regular SE or Plus without > Color QuickDraw will NOT draw anything to the screen. > I then discovered that if I set the PenMode to patXor, the procedure > then functions exactly to specifications. According to IM-1 p.157, PenMode gets either - pattern transfer modes, for drawing shapes with a pattern - source transfer modes, for drawing text or transferring any bit image between two bit maps. I.e., use PenMode (patXor) for FrameRect(). For the record, I've never been able to figure out why the distinctions is necessary, and apparently the Color QD designers couldn't either, but for use with older Macs try using the mode from IM-I. =Ned Horvath=