05-16-2011 04:15 AM
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
05-16-2011 07:42 AM
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.
05-16-2011 08:02 AM
You can use the 'Boolean XControl' which has the option to change the image on a system, classic or modern boolean.
Ton
05-16-2011 09:13 AM
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
05-16-2011 10:21 AM
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
05-16-2011 11:05 AM
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" )
Ian
05-16-2011 11:06 AM
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.