Programmatically Acquiring a Full Screenshot in LabVIEW

Updated Nov 22, 2023

Environment

Software

  • LabVIEW

Operating System

  • Windows

I want to acquire an Image of the full screen in my application. How can I do this using LabVIEW?

  1. Use the C:/Windows/System/user32.dll keywp_event function to simulate a print-keystroke
  2. This stores the current screen in the clipboard
  3. Use Clipboard.GetImage or .NET Framework to retrieve the Image from clipboard
  4. Save image to jpeg or png file using Save to PNG/JPG.vi or .NET Framework
The Clipboard.GetImage method is not available in the runtime engine.

Use this example if you only want to take screenshots from your LabVIEW IDE:
SaveScreenshotIDE.png
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 diagram.

Use this example if you want to take screenshots from the IDE or an EXE:
Save Screenshot in IDE or Executable
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 diagram.