allowing to save the canvas drawing and restoring it