Skip to main content
Version: 8.3 Beta 🚧

system.vision.printToImage

Backwards Compatibility

This function replaces system.print.printToImage. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.

This function is used in Python Scripting.

Description​

This function prints the given component (such as a graph, container, entire window, etc) to an image file, and saves the file where ever the operating system deems appropriate. A filename and path may be provided to determine the name and location of the saved file.

While not required, it is highly recommended to pass in a filename and path. The script may fail if the function attempts to save to a directory that the client does not have access rights to.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.vision.printToImage(component [, filename])

Parameters​

TypeParameterDescription
ComponentcomponentThe component to render.
StringfilenameA filename to save the image as. [optional]

Returns​

Nothing

Scope​

Vision Client

Code Examples​

Example #1
# This code would go on a button and save an image of the container that it is in.
system.vision.printToImage(event.source.parent, "C:\\temp\\Screen.jpg")
Example #2 - User Selected Location
# Again, this example would save an image of the container, but prompts the user for a 
# location and filename with system.vision.saveFile()

# Ask the user for a location. Uses a default filename of "image.png"
path = system.vision.saveFile("image.png")

# If the path is not None...
if path != None:
#Save the file
system.vision.printToImage(event.source.parent, path)