Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits/style
Scripting_function


Panel
titleDescription

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 permissions restrictions


Panel
titleSyntax

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

  • Parameters

Component component - The component to render. Refer to the list of Components objects.

String filename - A filename to save the image as. [optional]

  • Returns

nothingNothing

  • Scope

Vision Client

panel
Panel
titleCode Examples
Code Block
languagepy
titleCode Snippet
# This code would go on a button and save an image of the container that it is in.
system.print.printToImage(event.source.parent, "C:\\temp\\Screen.jpg")
Code Block
languagepy
titleCode Snippet - User Selected Location
# Again, this example would save an image of the container, but prompts the user for a location and filename with system.file.saveFile()

# Ask the user for a location. Uses a default filename of "image.png"
path = system.file.saveFile("image.png")
 
# If the path is not None...
if path != None:
	#Save the file
	system.print.printToImage(event.source.parent, path)
Panel
titleKeywords

system print printTolmage, print.printTolmage