Example Code

Display IMAQ Image to Canvas in LabWindows

Code and Documents

Attachment

Overview

There are many methods to display images, and with the IMAQ API you can display an image in its own window.  However, if you would like to embed the image in a form with other controls, we can copy our images to the Canvas control as well.

Description

This example code demonstrates how we can read in an IMAQ image, convert that image to a bitmap, then display the image within a canvas.

Steps to Implement or Execute Code

  1. Open the 'User Interface Application.prj file
  2. Run the code
  3. Select 'Read Image' and browse to an image
  4. The image will display within the canvas control

Requirements

Software

     LabWindows/CVI

     NI IMAQ vision software

Hardware

     N/A

Additional Images or Video

LWCanvas.PNG


Cole R.
National Instruments
Software Engineer

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

Contributors