Function

CGContextClipToRect

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

Declaration

void CGContextClipToRect(CGContextRef c, CGRect rect);

Parameters

c

The graphics context for which to set the clipping path.

rect

The location and dimensions of the rectangle, in user space, to be used in determining the new clipping path.

Discussion

This function sets the specified graphics context’s clipping region to the area which intersects both the current clipping path and the specified rectangle.

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.

CGContextEOClip

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

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software