Reference: saveViewAsBitmap
saveViewAsBitmap(s) saves the current 2D visualization window to the bitmap with file name s, a fully-qualified name. saveViewAsBitmap(s, w, h) saves the current 2D visualization window to the bitmap with file name s, a fully-qualified name. w and h is the width and height of the bitmap, respectively. The bitmap is rerendered using this canvas size.