Use the Get Image method to print 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 print an image of a single front panel object.
On the block diagram, right-click the control or indicator terminal you want to print and select Create»Reference from the shortcut menu to create a control reference.
Right-click the control reference and select Create»Method»Get Image to create an Invoke Node with the Get Image method selected.
Wire the control reference to the reference input of the Invoke Node.
Right-click the image depth parameter and select Create»Constant to create a numeric constant.
Enter 1, 4, 8, or 24 to set the color depth of the image.
Value
Definition
1
One-bit, black and white image
4
Four-bit, 16-color image
8
Eight-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 parameter.
Select one of the following VIs on the Functions»Graphics and Sound»Graphics Format palette and place it on the block diagram:
Select the Write JPEG File VI to save the image in the JPEG format.
Select the Write PNG File VI to save the image in the PNG format.
Select the Write BMP File VI to save the image in the BMP format.
Wire the image output of the Invoke Node to the color table input of the graphic format VI.
Wire the colors output of the Invoke Node to the flattened image data input of the graphic format VI.
Wire the bounds output of the Invoke Node to the rect input of the graphic format VI.
Wire an 8-bit, unsigned integer constant to the depth input of the graphic format VI and enter the same value you entered in the image depth input of the Invoke Node. The values must match.
Enter the directory and name of the image where you want to save the image in the path to format file input of the graphic format VI, where format is the graphic format of the image.
Run the VI to save the image to the directory.
The following example saves the front panel image of a waveform chart to the PNG format.