How can I reset or clear the clipping mask associated with a CGContext?
I'm drawing to a CGContext and using a CGImageRef-based mask:
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClipToMask(context, rect, _firstMaskImageRef);
CGContextSetFillColorWithColor(context, color);
CGContextFillRect(context, rect);
I have a second mask that I then want to switch to:
CGContextClipToMask(context, rect, _secondMaskImageRef);
CGContextSetFillColorWithColor(context, color); // color has changed FWIW
CGContextFillRect(context, rect); // as has rect
But, this intersects the two masks instead of replacing the first.
How do you (if you can) clear out or reset the clipping mask for a CGContext?
No comments:
Post a Comment