LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a boolean button as native LabVIEW buttons which is scalable without cosmetic effects?

Hi,

 

I am wondering how to create a LabVIEW boolean button which doesn't get affected if I scale the button to large size?

 

In the attached VI, I have scaled an LED button to very huge size and you can find that it's still not pixelated (i.e., whether it's big or small, it's cosmetically same), whereas the custom control get pixelated when I scaled the button.

 

Thanks,

Ajay.

--
Ajay MV


0 Kudos
Message 1 of 8
(3,862 Views)

If you just want a nice large button, customize an existing button and import a large graphics.

 

Customizing Individual Parts of Controls and Indicators

 

Importing Graphics into Boolean Controls and Indicators

0 Kudos
Message 2 of 8
(3,840 Views)

Hi Altenbach,

 

I understand how to create custom buttons and how to import large images for such custom buttons.  Thing is that, when I import large image and shrink it to small size, my button gets distorted as shown below.  You can find the pixelations and button's boudary gets modified as I scale it down.  On the other hand, the LabVIEW's native system button does not distorts as such.  There's my question, how we can prepare a custom button as LabVIEW's native button which can be scaled up and down without any distortion.

 

Large Stop Button Scaled Down vs Large System Button Scaled Down.png

--
Ajay MV


0 Kudos
Message 3 of 8
(3,821 Views)

I suspect the difference between the System Button and your Stop Button, among other things, is the rounded corners on the Stop Button are harder to "scale down" than square corners.  At some point in minification, some decision needs to be made how to produce the effect of a rounded button.  I would hope that a Graphics Design software package would have the smarts to do this, but I'm willing to forgive an "Engineering Workbench" from having such sophistication (particularly when it allow us to import nice graphics as overlays).

 

Bob Schor

0 Kudos
Message 4 of 8
(3,782 Views)

Your stop button is an image that looks good at a certain size (the native image size), but scaling an image is always difficult (and LabVIEW does not do a particularly good job in that respect).

The native button is a vector graphics which scales perfectly well.

Unfortunately you can't create custom buttons with vector graphics as far as I know.

 

0 Kudos
Message 5 of 8
(3,770 Views)

What kind of images are you importing to the custom controls? Have you seen this ( http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Improved-decoration-and-control-graphics/idi-p/919696 )

 

 

Actually, the custom control editor does allow the import of vector graphics, but it only supports certain WMF files.  You can use the Import Picture to clipboard function in the Edit menu of a custom control and then use that vector clipboard object for scalable custom booleans, ect.  It has some limits, though.  WMF is a crappy format with limited functionality, and some editors, like Inkscape produce output that trigger errors for certain objects.  I've had good luck with CorelDraw! using the Export to WMF with the "export selected only" option.  I can create custom rectangles, etc., that are scalable and can be used with booleans in LV.  However, there are often problems in rendering if you add a gradient, etc. 

 

EMF is also supported, I believe, but also leaves much to be desired, as fancy gradients and other such objects are not rendered properly by LV.  Also, some EMF/WMF custom controls don't render properly in LV on Windws Embedded (at least that's the way it was for XP embedded), so forget about using these kinds of scalable csutom controls on NI's touch panels, which is what I wanted them for in the first place.  I'm begging NI to add SVG import, and release SVG specifications with custom tags for each of the control types, starting with the simplest first (numerics, etc.).  That way, some enterprising 3rd party can create a full-featured vector-based editor (Inkscape plug-in?) that saves the data in an SVG file that LabVIEW can then import to a native control. 

 

Cheers

mcduff

Message 6 of 8
(3,738 Views)

WMF vector images is one of the tricks for sure.  One tool that not enough people know about is the Image Navigator.  For some reason it is bundled with the DSC toolkit, but runs just fine even if it isn't licensed by just running the EXE.  It basically has a set of WMF images that can be manipulated to some extent, then copied to your clipboard, where they can then be imported.

 

Other settings in LabVIEW regarding how to size and move images when a control is resized can also be exposed but isn't a complete feature and you can cause it to do some strange things.  Christina R talks about how to enable these and some of their issues here on LAVA.

Message 7 of 8
(3,710 Views)

Yea, I'm getting the crappy error when I tried to import an SVG file (below).  I don't have coral draw right away to try the other option, but will let you know once I get it up in my PC.

 

SVG Import to Clipboard Error.png

 

Cheers,

Ajay.

--
Ajay MV


0 Kudos
Message 8 of 8
(3,582 Views)