Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!orstcs!usenet!mist.CS.ORST.EDU!kempkec From: kempkec@mist.CS.ORST.EDU (Christopher Kempke) Newsgroups: comp.sys.mac.programmer Subject: Re: transfer mode that doesn't clobber black bits? Message-ID: <1990Dec26.111555.3333@usenet@scion.CS.ORST.EDU> Date: 26 Dec 90 11:15:55 GMT References: <3666@orbit.cts.com> Sender: @usenet@scion.CS.ORST.EDU Organization: Computer Science Department, Oregon State Univ. Lines: 35 Nntp-Posting-Host: mist.cs.orst.edu In article <3666@orbit.cts.com> pj@pnet51.orb.mn.org (Paul Jacoby) writes: >I am in the process of writing some simple graphics routines for a modeling >program. I have a screen which displays a grid filled with arrows. On each >arrow, I draw an arrowhead (how appropriate!). I then want to turn control >over the user, giving them the ability to vary parameters which make the >arrows swing like little VU meters (whooopee!). > >Problem: I draw the arrows (based on an array of endpoints) using >PenMode(patXor), and then go in an add the heads. If I leave the PenMode as >patXor, I end up knocking a few pixels out of the arrowshaft, at the points >where the head and shaft meet. However, if I change the PenMode to srcCopy, I >then have to figure out how to ERASE the arrowhead...using patXor seems so >convenient for the shaft, I'd love to use it for the head too. But those >dropped pixels look awful. > srcOr will do what you want, not dropping the pixels. "Erase" is generally a srcBic (Bit Clear) operation. Page I-157 of Inside Macintosh (I) gives little pictures demonstrating this. You'll have to do this in four steps: srcXor - Draw the shaft srcOr - Draw the head srcXor - Erase the shaft srcBic - Erase the head This assumes that your "heads" don't occlude anything but the shaft. If this isn't the case, then no, there's no solution (no pattern mode will determine "for" you that a given black dot comes from the "shaft" rather than some other object.) Hope this is clear, write me email if you need more. (Sorry for posting this, but I see the question or one like it a lot here.) --Chris Kempke (kempkec@mist.cs.orst.edu)