How to Add Decals to LabVIEW Buttons

May 3rd, 2010 by Christina in LabVIEW, User Interface

For today’s post, I would like to showcase a video from Simon Hogg’s presentation, “Creating Quality UIs with NI LabVIEW – Developer Days 2010 Presentation.” If you have time to read the whole thing, I highly recommend it. It has some really great content, including more tips and techniques like the one I discuss here.

Here’s Simon’s video: How to Add Decals to LabVIEW Buttons (YouTube).

A LabVIEW button with a decal image

A button with a decal image

What exactly are decals, you ask? Well, in the LabVIEW Control editor, you can always add arbitrary cosmetics (e.g. images) to a control. However, if you just paste in an image and move it on top of your button, you’ll find that you can’t click the button when you click on the image, because the image is in front of the button.

Decals solve this problem. They are images that are integrated with the button and thus do not interfere with its behavior.

Here are the steps demonstrated in the video, along with my additional comments:

  1. Place a button on the panel.
  2. Right-click and select Advanced>>Customize. (You could also choose Edit>>Customize Control from the main menu).
  3. From the menu, select Edit>>Import Picture to Clipboard. This is extremely important. LabVIEW does not currently preserve transparency through the system clipboard. If you copy and paste an image from another application, any transparency in the image will be lost. This menu option is the only workaround to use images with transparency inside LabVIEW.
  4. Right-click and select Import Picture from Clipboard>Decal. (You could add more than one, but you’re probably not going to need to do that very often).
  5. If you need to move the decal or boolean text, switch to Customize mode by clicking the toolbar button with the wrench icon. (It’ll change to tweezers). Make sure you change back to Edit mode if you want to continue editing the control normally.
  6. You can re-use the control easily by saving it to user.lib. After you restart LabVIEW, the control will appear in the User Controls category of the palette. You can also customize the icon and name displayed in the palette. To customize the icon, edit the control’s icon just like you edit a VI’s icon. To set its palette name, go to the Control Properties dialog, and in the Window Appearance category set the Window Title.

4 Comments

  • That was a wonderfully-informative presentation (I watched the whole thing!). My only mild gripe is Simon sometimes spoke softly, or let his voice drift off at the end of a sentence (but “There’s an App (volume control) for that”).

  • Thanks for explaining the meaning of DECAL! I have been using it for long time but not understanding its meaning behind.

  • This one feature is very well explained here. Helps a lot, especially, as the intuitive graphics can be used to make tiny buttons substituting the text entirely. This leaves with more area for the grabbed frame while making LabVIEW VI using NI vision development.

    Following this blog, every post. Thanks!

  • Thanks a lot for this blog update. this is really great

 

Comments have been closed for this post.