Skip to main content
Version: 8.1

system.print.createImage

This function is used in Python Scripting.

Description​

Takes a snapshot of a component and creates a Java BufferedImage out of it. You can use javax.imageio.ImageIO to turn this into bytes that can be saved to a file or a BLOB field in a database.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.print.createImage(component)

Parameters​

TypeParameterDescription
ComponentcomponentThe component to render.

Returns​

BufferedImage - A java.awt.image.BufferedImage representing the component.

Scope​

Vision Client

Code Examples​

Code Snippet
from java.io import File
from javax.imageio import ImageIO

component = event.source.parent.getComponent('TestPieChart')
bufferedImage = system.print.createImage(component)

rawPath = system.util.getProperty("user.home") + system.util.getProperty("file.separator") +"chart_createImage.jpg"
formattedPath = File(rawPath)

ImageIO.write(bufferedImage , "jpg", formattedPath)

Keywords​

system print createImage, print.createImage