Open and Display Image File in LabVIEW

Updated Nov 10, 2017

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base

Issue Details

I want to open a bitmap, jpeg or png file (regardless of its color depth) and display it on my front panel of a running VI. How can I do this?

Solution

You can attain this functionality by using the VIs in the Graphics & Sound palette. You can use the Read Bitmap File VI,  Read JPEG File VI, or Read PNG File VI followed by the Draw Flattened Pixmap VI.  The Read VIs are contained in the Functions»Graphics & Sound»Graphics Format palette, and the Draw VI is in Functions»Graphics & Sound»Picture Functions palette.
 

 

Additional Information

The combination of these two VIs allows for the reading and displaying of any image file in these formats, regardless of its color depth. To change the depth to a specific  level, you'll need to unflatten the data first and use the Draw Unflattened Pixmap VI. The example code snippet below works in LabVIEW 2013 and the attached examples work for LabVIEW 8.0, or LabVIEW 2011 and later. 

WAS THIS ARTICLE HELPFUL?

Not Helpful