system.vision.createImage
Backwards Compatibility
This function replaces system.print.createImage. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility.
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.vision.createImage(component)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| Component | component | The 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.vision.createImage(component)
rawPath = system.util.getProperty("user.home") + system.util.getProperty("file.separator") +"chart_createImage.jpg"
formattedPath = File(rawPath)
ImageIO.write(bufferedImage , "jpg", formattedPath)