From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How do you create custom graphics similar to the pipes that come with the automation symbols tool kit?

Please see the attached VI that demonstartes what I would like to do.

I would like to do my own graphics but have not figured how to get the images to change color when I use a property node.

I have tried exporting the picture and editing in MS paint, but I don't seem to be able to get the imgaes to come correctly.

Does anyone know how this can be done?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 1 of 13
(5,137 Views)
I don't think it's possible to design your own graphics that will respond to the colors property. What I've done is design a different colored graphic for each state and import them to the control's true and false state. If all that you need is two colors, this should work just fine.
Message 2 of 13
(5,133 Views)
Hi Dennis,

The app I am working on requires 4 colors.

Oh well, I guess its picture ring time again.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 13
(5,133 Views)
Ben,
You may look at the attached example. It makes the LED smoothly transition between two colors so that it appears to pulse. It may give you some ideas for your appllication.
To make an object in LabVIEW pulse, the color must be transitioned from one color to another. This can be done in a loop that changes the color in increments. The attached program, Pulsing LED.vi, uses Color to RGB.vi and RGB to Color.vi to calculate the transition colors between the two color states by calculating the difference in the component colors and dividing the difference by the number of steps in the transition. In each iteration of the loop, the color of the control is changed by this incremental step color. Color to RGB.vi and RGB to Color.vi are found
in the Functions » Graphics & Sound » Picture Functions.

How Do I Make LEDs or Other Boolean Objects Blink in LabVIEW?
http://digital.ni.com/public.nsf/websearch/53614F5A1E850ACC86256AB800658557?OpenDocument
Message 4 of 13
(5,132 Views)
HI Zvezdana,

Thanks for the link.

What I am actually looing for is a way to create an image that lookst like a three neck mixing flask and be able to set the colors using a property node while mainitaining all of the the shading and highlights.

I just don't seem to be able to get an image into the control that LV knows how to color.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 13
(5,132 Views)
> What I am actually looing for is a way to create an image that lookst
> like a three neck mixing flask and be able to set the colors using a
> property node while mainitaining all of the the shading and
> highlights.
>
> I just don't seem to be able to get an image into the control that LV
> knows how to color.
>

If your image has a color table and you can easily arrange for a
particular index to be each of the colors, then you can draw the pixmap
with a given color table and easily update it whenever you like.

It is possible to do this to metafiles, but they are more complicated to
parse out.

Another possibility is to make a function that drawn the object using
the picture control. This will take a bit more time,
but usually some
simple trig is all that is needed to make some scalable polygons that
look the way you like. It is then very easy to use a different color
for any of the elements in the picture.

One final, but very odd suggestion that I saw someone do years ago was
to make a collection of icons that cover other controls. They built an
flask by making around eight or 10 icons. The mask blocked out the
outside of the fill slide beneath it, but allowed the interior to be
seen. It looked like the fill slide has a flask shape and was very
cool, but I suspect it took awhile to make the icons. If using LV6.1,
you can do something similar using a single GIF and place it over a
color numeric, color ramp, picture control, or something similar that
changes the color.

Greg McKaskle
Message 6 of 13
(5,132 Views)
Ben,

Two things:

First, I have heard of a toolkit available that includes such graphics that is NOT from NI. Search for it on NI's website, I think that's where I found it. It may contain what you are looking for.

Second, go to the LabVIEW help. There are some examples of custom controls using pictures, color boxes and bars, and other methods of making custom controls that may inspire you. Just remember that you don't have to stick to booleans when it comes to custom controls.

When editing controls, I have found that in order to get images to move back and forth correctly through Windows, you have to have Powerpoint as the interface between LabVIEW and your image editor.


As a demonstration, I have added to your VI. I modified a
color box (control attached) to be a pipe.
Download All
Message 7 of 13
(5,134 Views)
by the way....

"properties not required"
0 Kudos
Message 8 of 13
(5,134 Views)
Can you elaborate on how you customezed the color box? I am able to import metafiles, preserving transparency, but I still can't modify a color box so the image is LabVIEW-colorable.

Thank you
Message 9 of 13
(5,102 Views)
Can someone have some appreciated time to create or to find for me these control/indicator buttons like these in oval or rectangular red/jade boxes ("digitized number display": something similar to the green ones on a virtual scope/meter from a Fluke or Keithley labview provided driver but I forgot where it is or exactly what model that was a few years ago; "next" control button)?

I've been working on a customized 3D shiny metallic red volume slide control and a few others. We should submit all customized controls to somewhere in this NI website so anyone can use them without RE-INVENTING the wheel and precious time.
Download All
0 Kudos
Message 10 of 13
(4,628 Views)