Export Image of Display
The Export Image command can be used to capture an image of the GraphWorX64 display running in an HTML5 browser or the MobileHMI app.
When used in a batch command, following commands can use the @@result[filename] context variable to retrieve the location of the saved image file for subsequent downloading or display.
These example steps can be used to create a button to export an image and open the file in a browser tab.
- Open GraphWorX64.
- Optional: At the bottom right of the window, set the mode to Web Browser.
- Make sure the display or GraphWorX64 Viewer has a commanding name.
- To set the commanding name of the current display:
- Select the canvas by deselecting all other objects.
- Go to Properties.
- Set SpecifyRuntimeWindowProperties to True.
- Expand RuntimeWindowProperties.
- Set CommandingName to your desired name. For example, gwx.
- To set the commanding name of a GraphWorX64 Viewer:
- Select the GraphWorX64 Viewer.
- Go to Properties.
- Set CommandingName to your desired name. For example, gwx.
- Add a button.
- For Command, choose Batch.
- Edit the command steps.
- Add an Export Image command.
- Edit the command parameters.
- Specify a FileName (such as test.png)
- Choose CurrentView for Area.
- For Target, enter the commanding name of the display or viewer you want to capture. For example, gwx.
- Select OK when done editing the parameters.
- Set the Timeout value to 5000.
- The export image action may take longer than the default of 1000 milliseconds. Depending on the system it may need longer than 5000. Adjust this value as needed.
- Add an Open URL command.
- Edit the command parameters. Select New Window for the TargetType and for URL, use this expression: {{x={{@@result[filename]}}}} Select OK when done editing the parameters.
- Select OK to the batch command configuration.
- Optional: Add some other shapes or text to the display.
- Save the display into the PubDisplay folder (or another web-accessible folder).
- Open the display in an HTML5-compliant browser. (If GraphWorX64 is in Web Browser mode, you should be able to use the Open in Web Browser button in the top right corner.)
- Select the button. An image of the current view should open in a new browser tab.
- If the new tab doesn't open after five seconds, consider increasing the timeout value in step 13.