LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically change button image

Is it possible to programatically change the image of a button, i.e. 1 image for the T state and another for F state? This has to happen programatically.

 

Thanks

 

Kas

0 Kudos
Message 1 of 7
(6,023 Views)

Hi Kaz,

You could try placing a picture control and overlaying it with a classic boolean.  Set the boolean to be transparent for True and False and update the picture when the button is pressed.  This will give you a very flexible approach as you say you need to change the picture programatically.  If the pictures dont change at runtime, then you could use a classic boolean and replace the true/false images with your own using the control editor.

Hope this helps,

Michael.

0 Kudos
Message 2 of 7
(6,011 Views)

You can use the 'Boolean XControl' which has the option to change the image on a system, classic or modern boolean.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 3 of 7
(6,003 Views)

TC: From what I found, the image still needs to be changed by the user when placed on FP. What I'm after is to use my own Images that I've done in Phtotshop, but, insert them programatically into the FP of another VI.

For this case, I'm buiding a POS, (Point-of-Sale), so the manager/user when adding a new menu item, they would have to load an image of a dish, i.e. pizza. And when the main POS system (main VI) is loaded, the new item is visible in the front pannel.

I tried using an array of clusters, and various other methods, but in the end, I still have to insert an image that acts like a Control button. These images have to be arranged like a ches board, where "black" represents a dish/image/button and the "white" represents background (i.e. nothing there).

 

Thanks

 

Kas

0 Kudos
Message 4 of 7
(5,989 Views)

Rivers: I havent really worked with Picture Controlls before. Do you have an example of the idea that you just mentioned. It'll give me a better idea How I may be able to implement this.

 

Thanks

 

Kas

0 Kudos
Message 5 of 7
(5,974 Views)

Attached is something along the lines of RiversDaddy's suggestion.

One boolean is just a customised control. The other is a transparent boolean sitting on top of a picture indicator. Each time the transparent boolean is clicked the image in the picture changes. To demonstrate how this can be changed programmatically I added a second boolean which causes different images to be displayed.

 

Note that before the code is run, the lower boolean is invisible - this could be easily fixed (but is left "as an excercise for the reader" Smiley Wink)

 

 

Ian

0 Kudos
Message 6 of 7
(5,962 Views)

Hi Kas,

I have done you a quick example.  Is this what you are looking for?  There is a different VI for loading jpeg files.

Kudos apreciated for a good answer 🙂

 

Michael.

0 Kudos
Message 7 of 7
(5,961 Views)