Punching holes in a graphic

Geoff Canyon Rev gcanyon+rev at gmail.com
Fri Apr 16 09:27:29 EDT 2010


Here's the effect I'm trying to achieve: I have an image on the card.
I want to partially obscure the image, making it
desaturated/darker/something like that, and then have areas of the
image that show through unaltered (preferably roundrect areas).

I can obscure the image by putting an opaque graphic over it and
setting the blendlevel on the graphic to 50, or by setting its ink to
blendExclusion.

I can make an area that shows through unmodified by grouping two
graphics: the larger is dark gray and the smaller is black. I set the
ink of the group to blendExclusion and get exactly what I want,
_except_: I want to be able to make multiple holes, and let each hole
have a border, and when two (or more) holes overlap, I want to see the
full border for both of them, even where they overlap. Since I'm
setting the ink on the group and not the individual graphics, when two
graphics overlap, the border on the lower-layered graphic is obscured.
I've tried setting ink values for each of the graphics separately,
which achieves the overlay effect I'm looking for, but I haven't found
any combination that does the "overall obscured but with pockets of
the original revealed" effect I'm looking for.

I just had a thought -- for each hole, I could have two graphics: one
opaque and one not. They would have the exact same rect, and all the
non-opaque graphics would have a higher layer than all the opaque
graphics. That way I could still set the ink on the group and have it
work. But that would be an ugly hack.

Any better ideas?

gc



More information about the Use-livecode mailing list