Exporting a LabVIEW Graph, Chart or 2D Picture to an Image File

Updated Dec 1, 2023

Environment

Software

  • LabVIEW

Sometimes the user might need to refer back to the previous charts, graphs, or 2D pictures obtained or generated in LabVIEW. LabVIEW offers a few methods to enable the user to easily save the charts, graphs, or 2D pictures in different format types. 
You will learn about three different ways to save charts, graphs, or 2D pictures as images in this article.
 

Use one of the following options to save a graph, chart, or 2D Picture indicator to an image file:
Manually Export Simplified Images From the Front Panel
  1. Right-click the waveform graph, chart, or 2D picture indicator and select Export >> Export Simplified Image from the shortcut menu.
  2. A dialog box will prompt you to select the image file type and destination.
This will produce a simplified, black-and-white image of the graph or chart.
Programmatically with the Export Image Method
  1. From the block diagram, right-click the waveform graph, chart, or 2D picture indicator.
  2. Select Create >> Invoke Node >> Export Image from the shortcut menu.
  3. Specify the Target, File Type, and Path as shown in the following screenshot:
This will produce a simplified, black-and-white image of the graph or chart in the same style as created by manually exporting the image from the front panel.
Note: The Export Image Method will not create the image file if the front panel is closed. This is commonly occurs when using this method used in a closed subVI. If this is a concern for you, consider using the Get Image Method. You can also configure the subVI to open the front panel when called by clicking File >> VI Properties >> Category >> Window Appearance >> Customize >> Show Front Panel When Called.

Programmatically with the Get Image Method
  1. From the block diagram, right-click the waveform graph, chart, or 2D picture indicator.
  2. Select Create >> Invoke Node >> Get Image from the shortcut menu.
  3. Add the Write JPEG File, Write BMP File, or Write PNG File VI to the block diagram from the Graphics Formats palette.
  4. Wire the Image Data output of the Get Image Invoke Node to the Image Data input of one of the write image file VIs, as shown in the following screenshot:
This will produce an image exactly as the graph appears on the front panel.
Note: Unlike the Export Image Method, the Get Image Method is capable of generating an image even if the front panel is closed. Use this method if you would like to also export the cursor legend.
 

Additional Information

When using the Export Image Method or the Get Image Method, LabVIEW uses the current data and properties of the graph or chart at the time the Invoke Node executes. Monitor the data to ensure LabVIEW takes creates the image at the time you desire.