Importing Pictures into a LabVIEW™ Picture Control

Updated Jul 31, 2026

Environment

Software

  • LabVIEW

Sometimes it is necessary to display an image on the Front Panel, for example when adding a logo. In LabVIEW, this is accomplished using a Picture Control, which is a control designed to display images programmatically. Images cannot be directly copied and pasted into a Picture Control. Instead, they must be loaded and rendered through code. If an image is copied from the clipboard or dragged onto the Front Panel, LabVIEW treats it as a decoration rather than as data within a control.

 

This document explains how to properly import an image into a Picture Control and how to resize the control to match the dimensions of the loaded image.

Follow the steps below to import an image into a Picture Control and resize it programmatically:

 

  1. Insert a 2D Picture control on the Front Panel from Modern>>Graph>>Controls in the Controls Palette.

  2. Go to the Block Diagram and place the appropriate Read Picture File VI from Programming>>Graphics and Sounds>>Graphics Formats in the Functions Palette. Select the appropriate Read Picture File VI depending on the type of picture, as shown below.     

 

 

  1. Right-click on the path to picture file input (for example: path to JPEG file) of the Read Picture File VI and select Create>>Control.

  2. Place a Draw Flattened Pixmap VI and an Empty Picture VI on the Block Diagram from Programming>>Graphics and Sounds>>Picture Functions in the Functions Palette.

  3. Wire the Empty Picture VI to the picture input of the Draw Flattened Pixmap VI, and its image data input to the image data output from the Read Picture File VI. Then, wire the new picture output of the Draw Flattened Pixmap VI to the 2D Picture control.

  4. Place an Unbundle By Name function on the Block Diagram from Cluster & Variant in the Functions Palette and wire it to the image data output of the Read Picture File VI.

  5. Expand the Unbundle By Name to have four outputs and assign them to Rectangle>>rightRectangle>>leftRectangle>>bottom, and Rectangle>>top.

  6. Place two Subtract functions and wire the outputs of the Unbundle By Name function to them. These will calculate the size for the image to be added.

  7. Place a Bundle function next to the Unbundle By Name to store the resulting dimension values.

  8. Right-click the 2D Picture control and select Create>>Property Node>>Draw Area Size to place the area size property node onto the Block Diagram.

  9. Right-click the property node and select Change All To Write.

  10. Wire the output of the Bundle function to the Draw Area Size property.

After following the steps above, your Block Diagram should resemble the LabVIEW snippet below.

 

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.