I am doing some drawing using a CGContext. I am currently masking the drawing using a png file like this:
UIImage * myImage = [UIImage imageNamed:@"frame.png"];
CGContextRef context = UIGraphicsGetCurrentContext ();
CGContextClipToMask(context, self.view.bounds, myImage.CGImage);
This works fine, but now I’d like to use an existing CGPathRef as my mask.
Should I look at converting the CGPathRef to a UIImage and mask as above?
If so how would I go about doing the conversion?
-OR-
Is there a better way to approach this?
1 Answer