OOF2: The Manual

Name

OOF.Graphics_n.File.Save_Canvas — Save the contents of the graphics window as an image file.

Synopsis

OOF.Graphics_n.File.Save_Canvas(filename, format, overwrite, pixels, background)

Details

  • Parent Menu: OOF.Graphics_n.File
  • Callback: function GfxWindow.saveCanvas in module ooflib.common.IO.ghostgfxwindow
  • Parameters:

    filename
    Name for the image file. Type: A character string.
    format
    Format for the image file Type: An object from the OutputImageFormat enumerated class.
    overwrite
    Overwrite an existing file? Type: Boolean: True or False.
    pixels
    Size in pixels of the largest dimension of the image. Type: Integer.
    background
    Fill the background? Type: Boolean: True or False.

Description

Save the contents of the Graphics window in a file. Everything on the Canvas is saved, not just what's visible in the scrolling region.

In the GUI, the filename widget at the top of the dialog box lets you choose the directory and file in which to store the resulting image. The OK button will be desensitized if the file already exists, unless overwrite is true.

The pixels parameter determines the resolution of the saved file. It is not the same as the number of pixels on the screen or the number of pixels in the Microstructure. If the region is square, the saved file will be pixels×pixels in size. If it's not square, the largest dimension will be pixels. It's necessary to specify pixels even when saving in PDF format.

If background is true, then any area of the background that is visible within the region will be drawn in the resulting image. If it's false, the background will be transparent (if possible).

[Note] Note

To save just a portion of the Canvas, use OOF.Graphics_n.File.Save_Canvas_Region.

See Also