Jump to content

Programatically add image on disk as decoration on front panel


tushar

Recommended Posts

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.

Link to comment

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

LabVIEWUI.png

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.

Link to comment

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)

  1. 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)
  2. 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)

Link to comment

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.

Link to comment

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)

post-17236-0-62995000-1298050006_thumb.p

Fab

Edited by Fab
Link to comment

my aims are as follows(and in same order of priority)

  1. 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)
  2. 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)

post-17236-0-00778100-1298067680_thumb.p

I hope this helps. The tool your are building sounds really cool, please let us know when is ready :)

set-backgroundORpicture.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.