Example Code

Zoom in on ROI of an Image at Cursor Location

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

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to zoom a IMAQ image programmatically.

 

Description

The example uses Vision Development Module functions to open and zoom in on an image in the location that the mouse cursor is hovering over. When the program is run image file is opened, then a region of interest (ROI) is created around the mouse position and this ROI is magnified in a new image display.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • Vision Development Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Run the VI
  2. (Optional) Change 'Zoom Factor' or 'Zoom Region Size' settings
  3. Hover over the 'Original Image' control to move the zoomed region

 

Additional Information or References

Magnify Cursor Position LV2012 NIVerified.vi - Front Panel.png

 

Magnify Cursor Position LV2012 NIVerified.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Matt
NI Community Team
National Instruments

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