tags:

views:

364

answers:

1

I would like to clip an image with path. In the book Programming with Quartz there is an example on how to draw a circle clipped by a rectangular path (p.37), and there is also a chapter on image masking with existing image as stencil (Ch.10). But I'm still not sure about how to clip an existing image using path. Is there any example or pointer?

A: 
krasnyk
Thanks, it worked! :)
huggie
Another question: How do I clip in a different region? I tried to use CGAffineTransform instead of the NULL there. But I end up having the image off-centered relative to the view.
huggie
BTW, a look into documentation says drawInRect should scale the image as need fit. In my code it doesn't appear to scale (though this is what I want). But I want several UIView with different regions.
huggie