Name

CRC.clip() — sets the clipping region of a canvas

Synopsis

void clip()

Description

This method computes the intersection of the inside of the current path with the current clipping region and uses that (smaller) region as the new clipping region. Note that there is no way to enlarge the clipping region. If you want a temporary clipping region, you should first call save() so that you can later restore() the original clipping region. The default clipping region for a canvas is the canvas rectangle itself.

Like the fill() method, clip() treats all subpaths as closed and uses the nonzero winding rule for distinguishing the inside of the path from the outside of the path.

Get Canvas Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.