LabVIEW includes two main ways to create icons interactively for LabVIEW items: the Icon Editor and drag-and-drop. The Icon Editor is the primary way to create icons in LabVIEW.

Creating Icons with the Icon Editor

The Icon Editor is the primary way to create or edit icons for items in LabVIEW.

The Icon Editor provides the following:

  • Icon templates
  • Glyphs from the Icon Library at ni.com
  • Options for adding and formatting icon text
  • Support for editing with layers

Depending on the type of item for which you want to create an icon, access the Icon Editor in the following ways:

Item How to Access Icon Editor
VI, custom control
  • Double-click the icon in the upper right corner of the front panel window, block diagram window, or Control Editor.
  • Right-click the icon and select Edit Icon.
Project library, statechart, class, or XControl Click the Edit button on the General Settings page of the corresponding Properties dialog box.
Note The Icon Editor displays icons in 24-bit color. However, LabVIEW displays icons only in 8-bit color on the block diagram. Therefore, the icon you create in this dialog box might appear slightly different from the corresponding icon on the block diagram.

Creating Icons by Dragging and Dropping Graphics

You can drag a graphic from anywhere in the file system and drop it in the upper right corner of the front panel window to use the graphic as a VI icon.

You can drag and drop files of the following formats:

  • .png
  • .bmp
  • .jpg

When you drag and drop a graphic, LabVIEW converts the graphic to a 32×32 pixel icon. Graphics that are much larger than 32×32 pixels, particularly those that have fine gradations of color, might not convert well.

Note VIs with smaller icons can be awkward to select and wire and might look strange when wired.
Notice If you modify an icon by dragging and dropping a graphic from the file system, LabVIEW creates a user layer called VI Icon for the graphic and deletes any other existing icon information from the Icon Editor.

Creating Icons Programmatically

You can use the VI Icon methods in the VI class to create icons.

Use the VI Icon:Set From File method to set the VI icon from an image programmatically.

Notice When you use VI Icon:Set From File, LabVIEW creates a user layer called VI Icon for the image and deletes any other existing icon information from the Icon Editor.