From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Take Screenshot of Front Panel Object While Running Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example shows how to save a JPEG file of your graph when clicking "Take a Screenshot" button.  

 

Description

This example is generating random data and outputting it to a chart.  When clicking the boolean Take a Screenshot you are able to save the Chart Image to a JPEG at that point in time.  A File Dialog window will open for you to save the JPEG image.  If you would like to save the image as a different extension you can replace Write JPEG File.vi with any other write function in the Graphics Formats Palette (Functions Palette >> Graphics & Sound >> Graphics Formats).

 

Requirements

Software

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Open Save Screenshot of FP Object.vi
  2. Run the VI
  3. Click "Take a screenshot" whenever you would like to save a screenshot
  4. Enter the name of the file in the File Dialog Window and click Save
  5. Click the Stop Button whenever you are done capturing data.

 

Additional Information or Reference

 

The program continues to run after you take the screenshot, so you can take multiple images of data throughout a test.

Save Screenshot of FP Object Snippet 2012 NIVerified.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Regards,

M. Whitaker
ni.com/support

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.