Jump to content

VI Icon: Difference between revisions

From LabVIEW Wiki
No edit summary
No edit summary
Line 1: Line 1:
== How to Make icons smaller than the entire square ==
== How to Make icons smaller than the entire square ==
First, draw the border for the icon in the B&W icon view. Be sure to align the icon to the wiring terminals by using the Show Terminal check box. This defines the icon outline. If you have no border drawn in the B&W view, it defaults to the whole square (in my limited tests, you get a "no outline in B&W view default will be used" dialog). The icon border will actually be the largest of the drawn areas in the three icon views. So actually, you need only draw a single dot on the B&W view to define your 256 colour drawing as the border limit. Something must be drawn in the B&W view to get the selection border for the icon on your diagrams to conform to the drawn outline (is this a useful feature? seems like you could have nothing drawn in this view by defaults and have it still work).
Sometimes it is desireable to make a LabView subVI's icon smaller than the normal 32x32 pixels. National Instruments has done this with several primitives and has made it possible for end users to make custom icons of any size for a subVI.


Second, Click on the 256 colour icon view (if that's what you use), and click Copy from Black & White to get your border. Then finish drawing the icon to your liking, link it up, and presto, small icon. Wires to border, transparent outside, etc. You can even make irregularly shaped icons. The white area outside will be transparent in your diagrams. Interestingly, if the border you define is not contiguous, the inside of your icon will also be transparent (you can see a wire go all the way to its connection point (visible as a little cross in the "show terminals" icon view). You can actually have multiple non-transparent areas in your icons if you wish. Very cool! You could have a wire pass between two blobs to represent some subtle transformation on the data if you really wanted to go all out, but this actually requires drawing wires between the connection points on the icon to make them look contiguous.
Starting with a typical icon editor<br />
[[Image:Typical_icon_editor.png]]<br />
<br />
Clear the default icon from the 256 icon, then click on the "Show Terminals" checkbox.  Draw a box, around the terminals you wish to have displayed on your custom icon.<br />
[[Image:Icon_editor_with_small_icon.png]]<br />
Fill the 256 color icon with a color of your choice, as well as any words or symbols you wish to use to describe your subVI's work, then copy the subVI to the black and white icon by selecting the black and white icon and pressing the copy from 256 color button on the right.<br />
[[Image:Icon_editor_with_all_small_icons.png]]<br />
 
 
You can even make irregularly shaped icons. The white area outside will be transparent in your diagrams. Interestingly, if the border you define is not contiguous, the inside of your icon will also be transparent (you can see a wire go all the way to its connection point (visible as a little cross in the "show terminals" icon view). You can actually have multiple non-transparent areas in your icons if you wish.  


== Other icon tricks ==
== Other icon tricks ==


Double clicking on some (any?) of the tool icons in the editing palette will apply that tool to the entire icon square. For instance double click on the dotted square selection tool will select the entire icon area (handy for deleting the icon as a starting point in making small icons). Double clicking on the bordered square will draw a border around the current icon in the currently selected colour, without affecting the inner pixels, etc.
There are certain tools in the icon editor that are "double-clickable".  Double clicking on the selection, filled box, and empty box tool icons in the editing palette will apply that tool to the entire icon square. Double clicking on the font tool will bring up a font dialog for selecting font name, size, color, justification, and style (bold, italics, etc). 
[[Image:Double_Clickable_Icon_Editor_tools.png]]


== Alternative Icon Editors ==
== Alternative Icon Editors ==
As of LabView 8.0 a custom icon editor could be built and called from LabView to edit icons of VIs.  The relevant information to replace the built in VI icon editor is avaliable [http://forums.lavag.org/index.php?s=&showtopic=3320&view=findpost&p=12920 here].

Revision as of 03:20, 8 May 2007

How to Make icons smaller than the entire square

Sometimes it is desireable to make a LabView subVI's icon smaller than the normal 32x32 pixels. National Instruments has done this with several primitives and has made it possible for end users to make custom icons of any size for a subVI.

Starting with a typical icon editor


Clear the default icon from the 256 icon, then click on the "Show Terminals" checkbox. Draw a box, around the terminals you wish to have displayed on your custom icon.

Fill the 256 color icon with a color of your choice, as well as any words or symbols you wish to use to describe your subVI's work, then copy the subVI to the black and white icon by selecting the black and white icon and pressing the copy from 256 color button on the right.


You can even make irregularly shaped icons. The white area outside will be transparent in your diagrams. Interestingly, if the border you define is not contiguous, the inside of your icon will also be transparent (you can see a wire go all the way to its connection point (visible as a little cross in the "show terminals" icon view). You can actually have multiple non-transparent areas in your icons if you wish.

Other icon tricks

There are certain tools in the icon editor that are "double-clickable". Double clicking on the selection, filled box, and empty box tool icons in the editing palette will apply that tool to the entire icon square. Double clicking on the font tool will bring up a font dialog for selecting font name, size, color, justification, and style (bold, italics, etc).

Alternative Icon Editors

As of LabView 8.0 a custom icon editor could be built and called from LabView to edit icons of VIs. The relevant information to replace the built in VI icon editor is avaliable here.