Jump to content
Jim Kring

Read XNode Icon

Recommended Posts

I'm trying to read the icon of an xnode by reading the NI.Lib.Icon property, which is encoded zipped binary data of the image.

This code generally works for reading any LVLib icon (note dependency on OpenG Zip Library).

Get Library Icon.png

I've noticed that for many XNodes, the icon data looks very weird, almost scrunched up. Any ideas why this would be the case?

2017-01-20_09-56-02.png

2017-01-20_09-54-17.png

And others look fine:

2017-01-20_09-55-05.png 

2017-01-20_09-58-07.png

Share this post


Link to post
Share on other sites

Could it be something to do with the fact that those two funny looking icons are expandable XNodes at edit time and expect to be redrawn on the diagram?

Edited by Neil Pate

Share this post


Link to post
Share on other sites

Great suggestion Neil.  Since an XNode can redraw the icon at run time.  Looking at the Xnode library icon it really does look messed up.

Untitled2.png

 

I'm guessing this is because the actual VI ran to generate the image is the C:\Program Files (x86)\National Instruments\LabVIEW 2015\vi.lib\variable\VRDraw.vi file, and if you just run that with the default inputs then it generates a nice clean image.  Honestly this looks like a fault of NI and they made their XNode library icons messed up, maybe with auto generated icons or because they knew they would be replaced with scripting.

Share this post


Link to post
Share on other sites
1 hour ago, Jim Kring said:

OK, so I'm not crazy. :-)

Well lets not jump to conclusions here. :P

Yes the XNode Editor I made a while ago allows for editing the icon associated with the library of the XNode, so even the community can set this static image of their XNode, even if the image generated by the ability is a different one

Share this post


Link to post
Share on other sites
On 1/21/2017 at 0:59 AM, Jim Kring said:

I'm trying to read the icon of an xnode by reading the NI.Lib.Icon property, which is encoded zipped binary data of the image.

This code generally works for reading any LVLib icon (note dependency on OpenG Zip Library).

Get Library Icon.png

I've noticed that for many XNodes, the icon data looks very weird, almost scrunched up. Any ideas why this would be the case?

2017-01-20_09-56-02.png

2017-01-20_09-54-17.png

And others look fine:

2017-01-20_09-55-05.png 

2017-01-20_09-58-07.png

For some reason, This snippet LV code (2015) won't work on my machine, Can you post a VI file. ? Thanks

Share this post


Link to post
Share on other sites

So I'm missing a VI in that snippet for the decoding part which looks like some kind of NI get icon library.  But attached is the VI that was that snippet, and another way of getting the icon if you don't mind opening references.  I think Jim was interested in getting the icon without VI Server for its usage in VIPM.

Get XNode Icon.vi

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, hooovahh said:

So I'm missing a VI in that snippet for the decoding part which looks like some kind of NI get icon library.  But attached is the VI that was that snippet, and another way of getting the icon if you don't mind opening references.  I think Jim was interested in getting the icon without VI Server for its usage in VIPM.

Get XNode Icon.vi

@hooovahh Thank You for the reply and attached VI code. 

Share this post


Link to post
Share on other sites

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.