How to Programmatically Acquire a Full Screenshot in LabVIEW

Updated Aug 25, 2026

Environment

Software

  • LabVIEW

Operating System

  • Windows

You can programmatically acquire an image of the entire desktop screen in LabVIEW by simulating the Print Screen key, retrieving the image from the Windows clipboard, and saving the image to a file. This method can be used in the LabVIEW Development Environment and, with the appropriate implementation, in a built application (EXE).
 
This article is intended for LabVIEW users who need to acquire and save screenshots from a Windows system.

  1. Simulate a Print Screen keystroke event using the Windows keybd_event function in C:\Windows\System32\user32.dll.
  2. Call the keybd_event function from user32.dll using the Call Library Function Node.

  1. Store the current screen image in the Windows clipboard.
  2. Retrieve the image from the clipboard using one of the following methods:
    • Application:Clipboard:Get Image
    • .NET Clipboard.GetImage. The .NET Clipboard.GetImage method is not available in all LabVIEW Run-Time Engine implementations.
  3. Save the image to a PNG or JPEG file.

After completing these steps, you can programmatically acquire a screenshot of the entire desktop and save it as an image file.

Example 1: Using Application:Clipboard:Get Image. Use the attached LabVIEW snippet or example VI to implement screenshot functionality using the VI Server method.

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block diagram.

 

To manually add the Application:Clipboard:Get Image method:
  1. Place an Invoke Node from the Application Control palette on the block diagram.
  2. Right-click the Invoke Node and select Select Class>>VI Server>>Application.

  1. Right-click the Invoke Node again and select Methods>>Clipboard>>Get Image.

 
 
Example 2: Using .NET Clipboard.GetImage. Use the attached LabVIEW snippet or example VI if you need to acquire screenshots using the .NET implementation.
 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block diagram.

 

To manually add the .NET Clipboard.GetImage method:
  1. Place an Invoke Node from the Application Control palette on the block diagram.
  2. Right-click the Invoke Node and select Select Class>>.NETFramework>>System.Windows.Forms.Clipboard.

  1. Select GetImage method.