From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 02/08/2010

If you are interested in adding custom glyphs to your listboxes, multicolumn listboxes, and tree controls, there is a great library of nicely-sized images that ships with LabVIEW here:

 

[LabVIEW]\resource\framework\providers\icons

 

These images are widely used within LabVIEW dialogs (you've probably seen many of them in the Project Window).  There are a few 48x48 and 128x128 images in there, but the majority are 16x16, which makes them perfect for use within list-based controls on the front panel, as seen here:

 

cool_glyphs.png

 

And a mini-nugget from the screenshot:  notice that you can assign the image data for a particular glyph index *after* you've assigned that glyph index to a particular item in the tree/MCL/listbox.

Message 1 of 20
(13,153 Views)
Is it possible to add custom icons to the [LabVIEW]\resource\framework\providers\icons directory?  Is it as simple as drag and drop?  Is this by any chance the same list of icons used with the new icon editor as glyphs?  Thanks!
0 Kudos
Message 2 of 20
(13,133 Views)

If you have write access to the LabVIEW directory, you can add whatever you want into that folder, although you would need to remember to copy it over to any future LabVIEW installations.

 

I don't think the icon editor uses any of the glyphs in this folder...it uses the glyphs in [LabVIEW Data]\Glyphs, and I believe the contents of this folder are populated from ni.com upon first use of the Icon Editor.  Also, not all of the glyphs in the icon editor library are 16x16.

Message 3 of 20
(13,123 Views)

I never thought of using Glyphs in listboxes...  I didn't know that it could be done.  I guess there are no limits to LabVIEW..

 

This is great.  Hope to have a reason to implement it in a software in the near future..

 

Thanks Darren!

0 Kudos
Message 4 of 20
(13,071 Views)

Thanks, Darren for point to this resource and nice nugget!

 

As small addition - there are some free NI icons also can be found here:

 

Icon Library

 

Andrey.

 

Message 5 of 20
(13,009 Views)
I've also found that you can import pictures directly into the block diagram as constants, so that they are embedded into your VI.  To do this, load your picture into a picture indicator and run your VI once.  When your stop your VI, right-click on the indicator and select "Create constant" to make your picture appear on the BD.  Now, wire your picture constant into the Picture to Pixmap VI and you can use it with the Custom Item Symbols Property Node like Darren shows.
Message 6 of 20
(12,902 Views)

A nice collection of free 16x16 pixel general purpose glyphs are available here.

 

There are also 16x16 pixel national flags available from the same site located here.

 

I've used these in listboxes in the past with my own apps.

 

Nice nugget!


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 7 of 20
(12,772 Views)

Some links to icons collections: 

 

Where to find CVI icons

(be careful - not all of them are commercial-free)

 

Andrey.

 

0 Kudos
Message 8 of 20
(12,760 Views)

I'll have to pick up some of these icons sets.  Here's one I use:

 

http://tango.freedesktop.org/Tango_Icon_Library

 

The link has 16x16, 22x22, and 32x32 icons.  I use these in my listboxes and in my VI icons.

0 Kudos
Message 9 of 20
(12,745 Views)

One additional thing:

 

I once created an 'upgrade tool' that would show the contents of a folder and subfolders in a tree control.

 

I wanted to display the system icon for each registered file type that  was displayed in the tool.  I used a private method of LabVIEW (Get Shell Icon of File) to retrieve the glyph, then loaded this into the symbols array of the tree.

 

I've attached the low level VI that retrieves the shell icon, but the VI is password protected. ( vi in LabVIEW 8.6)

 

This type of VI might be a nice addition to the standard LabVIEW libs, or may even already exist (I couldn't find it).

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 10 of 20
(12,737 Views)