tushar Posted February 17, 2011 Report Share Posted February 17, 2011 i want to add images on disk as the decoration on the front panel. also i would like to know how to add decal image to the control through vi scripting. Quote Link to comment
jgcode Posted February 17, 2011 Report Share Posted February 17, 2011 Check out the LAVACR. Vugie and Franswa have already nutted out the VI Scripting. Quote Link to comment
crelf Posted February 17, 2011 Report Share Posted February 17, 2011 As an aside - little know feature (due to accessing it IMHO): right-click on a front panel's horizontal scroll bar and select "properties" - now you can set a static background. Quote Link to comment
Francois Normandin Posted February 17, 2011 Report Share Posted February 17, 2011 There is no way to script your way through decals. The buttons API is non-existent and has never been refactored by NI since, I might be wrong here, LabVIEW 2.0. You need to play with the PNG's encoded in the .ctl file to manipulate them programmatically. Below are links to the code that Jon was talking about. First, install UI Tools Then, the Control Class Add-on. Once you restart LV, you'll get "Control Generator" in the Tools menu. The rest is supposed to be intuitive from there. Quote Link to comment
Phillip Brooks Posted February 17, 2011 Report Share Posted February 17, 2011 Tushar, I am very impressed with your example on UI customization on your blog! I'm sharing the image here to show everyone what a nice job you've done... Is your question related to extending this example? http://www.jambhekar.com/blogs/?p=19 Quote Link to comment
tushar Posted February 18, 2011 Author Report Share Posted February 18, 2011 Tushar, I am very impressed with your example on UI customization on your blog! I'm sharing the image here to show everyone what a nice job you've done... Is your question related to extending this example? http://www.jambhekar.com/blogs/?p=19 Thank you very much Phillip. In past we have developed lots of modbus dataloggers and now we have created fully configurable system(soon we are going to make it available free of cost to community). and i am thinking to add some typical SCADA features to it. so want to develop WYSIWYG editor. This editor will work as plugin vi creator and users can add their own mimic panels. I understand that people will need to have labVIEW and they need to run editor as source code and exe wont work. This question was related to development of that editor. Quote Link to comment
tushar Posted February 18, 2011 Author Report Share Posted February 18, 2011 There is no way to script your way through decals. The buttons API is non-existent and has never been refactored by NI since, I might be wrong here, LabVIEW 2.0. You need to play with the PNG's encoded in the .ctl file to manipulate them programmatically. Below are links to the code that Jon was talking about. First, install UI Tools Then, the Control Class Add-on. Once you restart LV, you'll get "Control Generator" in the Tools menu. The rest is supposed to be intuitive from there. first of all thanks for providing such a great utility. How ever i am not looking at just a way to customize boolean controls. my aims are as follows(and in same order of priority) put image as decoration on front panel (same thing as if we drag a png file from explorer and drop it to empty area on front panel) customize all kinds of controls to add images to them, alter dimensions of its parts Also in CR the critical part is password protected can you email mw password (tushar@jambhekar.com) Quote Link to comment
Ton Plomp Posted February 18, 2011 Report Share Posted February 18, 2011 The boolean XControl allows you to dynamically change the picture on a boolean. Ton Quote Link to comment
Francois Normandin Posted February 18, 2011 Report Share Posted February 18, 2011 Also in CR the critical part is password protected can you email mw password (tushar@jambhekar.com) Unfortunately, the password you mention has been put there by NI, not myself. That's why I mentioned that the API is non-existent for the control editor. 2- customize all kinds of controls to add images to them, alter dimensions of its parts If you want to dig into this, the Control Class add-on creates controls based on templates stored in the LabVIEW Data directory. If you were to somehow create these templates dynamically to the size you wish, you can use the Control Class API to add images and text where you want and the size you want it. The setback here is that those controls cannot be edited (apart from text) once created... The image becomes part of the button background, so I can see why you'd want to stay clear of this solution. Quote Link to comment
Fab Posted February 18, 2011 Report Share Posted February 18, 2011 (edited) I use the VIs in the "Graphics & Sounds>>Graphic Formats" palette, there are VIs to read png, jpeg and bmp. That combined with what crelf posted earlier results in the following snippet for LV2010 (snippets remove the direct link to the pane for the property node) Fab Edited February 18, 2011 by Fab Quote Link to comment
Fab Posted February 18, 2011 Report Share Posted February 18, 2011 my aims are as follows(and in same order of priority) put image as decoration on front panel (same thing as if we drag a png file from explorer and drop it to empty area on front panel) customize all kinds of controls to add images to them, alter dimensions of its part Tushar, I thought more about this and if you want the same as when "we drag a png file from explorer and drop it to empty area on front panel." Then a picture control would do the trick, you would only need to adjust the picture size to the image size. (I am not attaching a snippet this time, because it removes the direct reference to the picture control, but you can download the attached VI) I hope this helps. The tool your are building sounds really cool, please let us know when is ready set-backgroundORpicture.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.