This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Customize LabVIEW Boolean Controls with Bitmap Images or GIFs

Updated Aug 24, 2023

Environment

Software

  • LabVIEW

I want to customize my Boolean controls in LabVIEW using an Image file for true and false.

LabVIEW 6.x and Higher

Complete the following steps to import graphics into a Boolean control or indicator with the Control Editor window in a new or existing Custom Control file.
 
  1. To create a Custom Control in LabVIEW select File»New…»Other Files»Custom Control. You can place down any Boolean control, but a System Radio Button (located in the System palette) or a Flat Square Boolean (located on the Classic»Classic Boolean palette) are recommended.  These Booleans are good to use for this application because they don't have any shading.
  2. Select Edit»Import Picture from File to display a file dialog box. (In LabVIEW 8.2 and later you will select Edit»Import Picture to Clipboard...)
  3. Navigate to the graphic you want to import.
  4. Select the graphic and double-click the graphic or click the Open button. This will place the graphic on the LabVIEW clipboard.
  5. Right-click the Boolean control or indicator, select Import Picture from Clipboard from the shortcut menu, and select among the following items:
    • False – Applies the imported graphic to the FALSE state of the Boolean control or indicator. The imported graphic appears only when the control or indicator is in the FALSE state.
    • True – Applies the imported graphic to the TRUE state of the Boolean control or indicator. The imported graphic appears only when the control or indicator is in the TRUE state.
    • Decal – Applies the imported graphic to all states of the Boolean control or indicator. The graphic remains visible regardless of the state of the Boolean control or indicator.
  6. Repeat steps 2 through 5 to add a different image to a different state of the boolean.

Refer to the LabVIEW Help file that you are using "Importing Graphics into Boolean Controls and Indicators" for the most recent version of these instructions.
 

LabVIEW 5.x

You can import bitmap images to represent the TRUE and FALSE cases of a Boolean control or indicator by using the Control Editor to import pictures from the Clipboard.

There is more than one way to place a bitmap image on the Clipboard. In LabVIEW, you can import the picture from a file by selecting Edit»Import Picture from File. Or you can copy an image to the Clipboard by selecting Edit»Copy from within a paint utility (such as MS Paint). Once the bitmap is on the Clipboard, you can use the Control Editor to assign the image to a Boolean control. Note that the different techniques can result in different amounts of data being saved into the resulting VI.

Follow these steps:
  1. Place a Boolean control on the front panel.
  2. Use the positioning tool (arrow cursor) to select the boolean control.
  3. Select Edit»Edit Control... and the Control Editor window will pop up.
  4. Store the FALSE condition image onto the Clipboard as described above.
  5. Right click on the Boolean control in the Control Editor window, and select Import Picture»False.
  6. Store the TRUE condition image onto the Clipboard.
  7. Right click on the Boolean control in the Control Editor window, and select Import Picture»True.
  8. Select File»Apply Changes.
  9. If you wish, you can save your custom control for later use.
  10. Close the window, and return to the front panel.
 

Additional Information

To have an image's background be transparent disable the background layer in a photo editor.  Save the file in a type that supports transparency such as PNG. Then follow the steps outlined above for your version of LabVIEW. 
Also note that the entire outline of the control (including the transparent background) will still be clickable.