Example Code

Moving a Picture in a Picture Control 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

Download All

Overview

This VI shows how to move any picture in LabVIEW with Event Structure. 

 

Description

If you have ever used a picture in LabVIEW (not the 3D picture control) you will notice that anything you draw or load will be in the top left corner. Sometimes that can be very convenient, and other times, it can be quite the opposite. Imagine that you have 2 images, one you DO want to be in the top left corner, but you want to put the other image below the first, or next to it. With this VI, you can see how that is done.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Extract the zip to the same folder, and run the VI.
2. You can then use the arrow keys to move the image around. You will notice that there is an event structure that sees when you hit one of the arrow buttons.
3. Lets say you hit Right arrow. It will add 5 pixels to the right side, but also 5 pixels to the left side, so as to not stretch the image (Or squash it in the other direction).

 

Additional Information or Resources

2012.PNG

 

 

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

 

 

 

Chris Van Horn
Applications Engineer

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