Use the Get Image method to generate an image of a single front panel object. Use the Append Control Image to Report VI to append an image of a front panel object to a report.
Complete the following steps to use the Get Image method to generate an image of a single front panel object.
- On the block diagram, right-click the terminal of the control or indicator for which you want to generate an image and select Create»Invoke Node»Get Image from the shortcut menu to create an Invoke Node.
- Right-click the Image Depth input and select Create»Constant from the shortcut menu to create a numeric constant.
- Enter 1, 4, 8, or 24 in the numeric constant and press the <Enter> key to set the color depth of the image.
| Value |
Definition |
| 1 |
1-bit, black and white image |
| 4 |
4-bit, 16-color image |
| 8 |
8-bit, 256-color image |
| 24 |
24-bit, true-color image |
- (Optional) Specify a background color for the image by wiring a color box constant or a numeric color value to the BG Color input.
- Place one of the following VIs on the block diagram:
- Wire the Image Data output of the Invoke Node to the image data input of the graphic format VI.
- Right-click the path to format file input of the graphic format VI and select Create»Control from the shortcut menu, where format is the graphic format of the image.
- In the path to format file front panel control, enter a path that includes the directory where you want to save the image and a filename for the image.
Run the VI to save the image to the directory you entered.
The following block diagram saves an image of a waveform chart to the PNG format.
You also can create a subVI that contains the Invoke Node and wire a control reference to the subVI.