To download NI software, including the products shown below, visit ni.com/downloads.
Import a VI Snippet (*.png) image programmatically using pure LabVIEW code (No external dlls or dependencies).
Pastes this VI Snippet ("..\basic.png"):
Programmatically into an existing or new VI:
Description-Separate-2
1. Open the "Import VI Snippet.llb:Import VI Snippet Example.vi"
2. Enter the "VI Snippet Path (*.png)"
3. Optional, enter the "Drop Position" in pixels where the code should be positioned on the block diagram
4. Run the VI
The VI Snippet code will import into a new VI.
How-Separate-2
VI Snippets are no more than custom PNG data chunks that contain the binary VI file. The library saves and loads the "niVI" chuck to the clipboard (within the context of the block diagram) and then pastes the code to the destination VI specified.
VI Snippet PNG Chunks:
Under the hood, this library does the following:
Note: This uses VI Scripting to make a selection of all block diagram objects (i.e. decorations, nodes, sub VIs, wires, etc.) and copys the GObjects to the clipboard in the context of the block diagram. This is a workarround due to the inconsistent nature of the "Place object on cursor" IDE method.
Additional-Separate-2
Related-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.