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.
- 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.
- 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...)
- Navigate to the graphic you want to import.
- Select the graphic and double-click the graphic or click the Open button. This will place the graphic on the LabVIEW clipboard.
- 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.
- 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:
- Place a Boolean control on the front panel.
- Use the positioning tool (arrow cursor) to select the boolean control.
- Select Edit»Edit Control... and the Control Editor window will pop up.
- Store the FALSE condition image onto the Clipboard as described above.
- Right click on the Boolean control in the Control Editor window, and select Import Picture»False.
- Store the TRUE condition image onto the Clipboard.
- Right click on the Boolean control in the Control Editor window, and select Import Picture»True.
- Select File»Apply Changes.
- If you wish, you can save your custom control for later use.
- 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.