[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
That shimmering affect
- To: LYNCH@ARISTOTLE.ILS.NWU.EDU
- Subject: That shimmering affect
- From: ST.CLAIR@AppleLink.Apple.COM (St. Clair, William)
- Date: 18 Jun 91 16:42 GMT
- Cc: INFO-MCL@CAMBRIDGE.APPLE.COM
From: email@example.com (Richard Lynch)
Anybody know how to acheive that shimmering effect on the region being
built by (open-region ) or any region for that matter.
I'm talking about the way something looks in MacPaint et al when the lasso
is being used to highlight it.
PS I'm NOT trying to garner the non-white space pict information within
the region, I just want a region...
"TANSTAAFL" Rich firstname.lastname@example.org
Here's a guess at how HyperCard's lasso tool does it's work. I've never
written code that does this, so I may have it partly wrong.
First calculate the "Mask Region" by doing an OpenRgn, FrameRgn of the
user's outline (as drawn with the lasso tool), then draw the picture
(want the lines and framed figures to get added to the region definition),
Now, you need four patterns:
Note that as you go from one to the next, a loop back to the top, the bits
move to the right and down.
You need two off-screen temporary buffers.
Name them last-buf and this-buf
At each time step (you'll have to experiment with delays):
Select the next of the four patterns.
FrameRgn the "Mask Region" into the scratch buffer using the pattern.
XOR last-buf into this-buf.
XOR this-buf onto the screen.
Swap the assignments of this-buf and last-buf.