Example Code

Programmatically Set an Image as Front Panel Background

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

Overview

This example demonstrates how to set the background image of a Front Panel programmatically through VI Server.

 

Description

This example uses VI Server to programmatically set the background of a Front Panel to an image loaded from disk.

It converts a VI's file path to a reference to the VI using Open VI Reference. The reference to the VI enables you to access the panel of the VI. The panel itself provides programmatically access to all panes. The pane offers a BackgroundImage property node. The example loads an image and populates the image to the BackgroundImage property node.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open the [Main] ...VI and follow the instructions on the Front Panel

 

Additional Information or References

[Main] Set Image As Front Panel Background - Front Panel.png
[Main] Set Image As Front Panel Background - Block Diagram.png

 

If you would like to apply the image to the background of the current VI's front panel, replace Open VI Reference with VI Server Reference available in the Application Control palette.

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

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

Comments
Khazman
Member
Member
on

how to revert back the vi to normal condition?