Open and Display Image File in LabVIEW

Updated May 8, 2024

Reported In

Software

  • LabVIEW

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 VIRead 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.

These functions are not supported on RT targets. If you want to display an image in the RT target (from the development PC or with an embedded UI) you will need to use Vision RT (installed with Vision Development Module).