Example Code

Continuous Screen Capture in 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 VI captures the region of the screen and displays it on the front panel continuously which can be used to develop remote desktop applications.

 

Description

This code demonstrates how to utilize .NET functions in LabVIEW to continuously capture the region of the screen. It is not a simple print screen algorithm, but a high-performance implementation using the low level .NET functions in LabVIEW.

 

Requirements

  • LabVIEW 2013 (or compatible).

 

Steps to Implement or Execute Code

  1. Put in the desired Height and Width of the screen that you wish to capture.
  2. Run the program.
  3. Move your cursor and notice the change in the captured image.

Additional Information or References 

Front Panel

capture.JPG 

 

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

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

Comments
Member
Member
on

Nice!

Member
Member
on

This is a good project. We can use it in our project. I wonder if this can be use to extend the display to a second screen like what certain devices can do (e.g. USB-to-VGA connector). We want to send the captured image to an FPGA board and transfer that image from the board to a screen in a VGA based signal.

Member
Member
on
I think you just saved my project!! THANKYOU!!! I used to capture screenshot with Acethinker Screen grabber, free and works fairly well. Share it here as an alternative method.
Member
Member
on

The Vi works great expect for a small memory leak.

I used it in a loop and got my memory full after a couple of hours.

 

the problem was that the references needed to be closed after disposing their content.