Example Code

Convert an IMAQ Image Into a Pixmap to Use a 2D Picture Control

Code and Documents

Attachment

Download All

Overview

These VIs demonstrate how to take a color or grayscale IMAQ image and transform it into a pixmap to be displayed on a 2D picture control.

Description

The project contains a VI called ImageToPicture that takes in an IMAQ image as an input. This image is then converted to an array that is flattened to a pixmap and then drawn to allow it to be displayed on a 2D picture control. The example demonstrates what colors are necessary as inputs for the Flatten Pixmap VI for an RGB or an 8Bit grayscale IMAQ image.

You may use the code as is within your project by dropping the ImageToPicture.VI as a SubVI or, if you will only be using grayscale images, just take the ImageToPicture_Grayscale SubVI.

Steps to Execute

  1. Open the project
  2. Run the Demonstration VI
  3. Browse to a file when the dialog pops up. An example image has been packaged with the project.

Requirements

Software

LabVIEW 2010 or later with associated IMAQ driver

National Instruments
Applications Engineer

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

Comments
wh_wang
Member
Member
on

This is an interesting program.

May I ask what the situation is suitable for use IMAQ converted into 2D PICTURE

Contributors