LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Addtion of PNG files in a Package for Control Palette

I am trying to generate a Palette containing a bunch of elements for User Interfaces. This palette contains all the .ctl files but some of my elements are stored in .png files. Theorically it is as simple as drag-and-drop the png into the Front Panel of the UIs and it will appear as a decoration. What I am trying to do is instead of searching for this png files every time, having a palette that already contains this png elements. 

Option 1. Is there a way of adding a .png to the Controls Palette? 

Option 2. Converting all of the .png to .ctl by creating one control for each one of the elements. For this I tried to automate adding the .png as a decoration in the front panel - as simple as the drag and drop, but programmatically. I am stuck on this point where i need to create a new decoration out of a .png programatically, but no information have I found about this topic. 

What I'm requesting is to get any feedback on how to resolve the problem with either option 1 or 2. 

 

0 Kudos
Message 1 of 3
(98 Views)

If the png is a VI Snippet, it is a VI appended to the end of the png.  You can simply split the file by search for the VI "header": RSRC.  A VI can have more than one RSRC.

 

George Zou
0 Kudos
Message 2 of 3
(59 Views)

Without digging too much into it, here are a couple of options for option 2:

 

  1. Use the options described here to edit the image of a boolean.
  2. Copy the image to the clipboard, create your control, get its FP and from that the pane and use the paste method for the pane.

Note that in both cases, you will have a control in the end, which will have a corresponding terminal in the BD.

 

Another option would be to build your own floating palette and drag from there (probably using the copy and paste method). This is a bit trickier because deciding when to open and show the palette and handling the dragging can probably a pain (another partially transparent window?).


___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(33 Views)