Function

CGContextEOClip

Modifies the current clipping path, using the even-odd rule.

Declaration

void CGContextEOClip(CGContextRef c);

Parameters

c

A graphics context containing a path. If the context does not have a current path, the function does nothing.

Discussion

The function uses the even-odd rule to calculate the intersection of the current path with the current clipping path. The path resulting from the intersection is used as the new current clipping path for subsequent painting operations.

If the current path includes any open subpaths, the paths are treated as if they were closed by calling CGContextClosePath.

Unlike the current path, the current clipping path is part of the graphics state. Therefore, to re-enlarge the paintable area by restoring the clipping path to a prior state, you must save the graphics state before you clip and restore the graphics state after you’ve completed any clipped drawing.

After determining the new clipping path, the function resets the context’s current path to an empty path.

See Also

Modifying Clipping Paths

CGContextClip

Modifies the current clipping path, using the nonzero winding number rule.

CGContextClipToRect

Sets the clipping path to the intersection of the current clipping path with the area defined by the specified rectangle.

CGContextClipToRects

Sets the clipping path to the intersection of the current clipping path with the region defined by an array of rectangles.

CGContextGetClipBoundingBox

Returns the bounding box of a clipping path.

CGContextClipToMask

Maps a mask into the specified rectangle and intersects it with the current clipping area of the graphics context.