Import Pictures into a Picture Control

Updated Jan 8, 2019

Reported In

Software

  • LabVIEW Full

Driver

  • NI-IMAQ

Issue Details

Can I import pictures into a Picture Control? I want to copy an image into my control

Solution

You cannot copy and paste images into a Picture Control. However, you can read an image into a pixmap, which is a 2D array of data with each data point mapped to a color. To do this:

  • Use the Read PNG File, Read JPEG File, and Read BMP File VIs from the Functions»Programming»Graphics & Sound»Graphics Formats palette.
  • Then use the Draw Flattened Pixmap to display the image in a Picture Control. These VIs are located on the Functions»Programming»Graphics & Sound»Picture Functions palette.

Below is an example of how you could read a JPEG image and display it in Picture Control.

Additional Information

Note: The Picture Control is different from the Picture Ring. In LabVIEW 7.x you are able to drag and drop an image into the Picture Ring Control.