OOF2: The Manual
Name
OOF.Graphics_n.File.Save_Canvas_Region — Save a region of the graphics window as an image file.
Synopsis
OOF.Graphics_n.File.Save_Canvas_Region(filename, format, overwrite, pixels, background, lowerleft, upperright)
Details
- Parent Menu: OOF.Graphics_n.File
-
Callback: function
GfxWindow.saveCanvasRegionin moduleooflib.common.IO.ghostgfxwindow -
Parameters:
filename- Name for the pdf image file. Type: A character string.
format- Format for the image file Type: An object from the
OutputImageFormatenumerated class. overwrite- Overwrite an existing file? Type: Boolean: True or False.
pixels- Size of the largest dimension of the image in pixels Type: Integer.
background- Fill the background? Type: Boolean: True or False.
lowerleft- Lower left corner of the saved region, in physical coordinates. Type: A
Pointobject (eg,Point(1.1, 2.0)). upperright- Upper right corner of the saved region, in physical coordinates. Type: A
Pointobject (eg,Point(1.1, 2.0)).
Description
Save a rectangular region of the contents of the Graphics window in a file.
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 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).
lowerleft and upperright
determine the rectangular portion of the Canvas that will be saved.
They are positions in physical
coordinates. In the GUI, when the Save Canvas
Region dialog is opened, lowerleft and
upperright are preset to the corners of the
currently visible part of the Canvas.
![]() |
Note |
|---|---|
|
To save the entire Canvas, use OOF.Graphics_n.File.Save_Canvas. |


![[Note]](IMAGES/note.png)

