Name

CRC.save() — saves a copy of the current graphics state

Synopsis

void save()

Description

save() pushes a copy of the current graphics state onto a stack of saved graphics states. This allows you to temporarily change the graphics state, and then restore the previous values with a call to restore().

The graphics state of a canvas includes all the properties of the CRC object (except for the read-only canvas property). It also includes the transformation matrix that is the result of calls to rotate(), scale(), and translate(). Additionally, it includes the clipping path, which is specified with the clip() method. Note, however, that the current path and current position are not part of the graphics state and are not saved by this method.

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.