Technical Q&A QA1050

Turning Off Core Graphics Clipping

Q:  I've used CGContextClip, CGContextEOClip, CGContextClipToRect, or CGContextClipToRects to modify the clipping path for the current context. However, all of these functions intersect the current clipping path with the new path. How do I reset or turn off the clipping path?

A: In order to clear the clipping path, you must save the graphics state for the context using CGContextSaveGState before you alter the clipping path. You can then reset the clipping path to its original state by calling CGContextRestoreGState.



Document Revision History


DateNotes
2013-08-13

Updated formatting.

2001-07-02

New document that explains how to clear the clipping path for a CGContext.