LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture a front panel object

Attached is a VI that captures an image of the front panel and stores it as a flattened pixmap in an array of clusters. Each cluster also includes a numeric indicator to show which capture it was (1, 2, 3, etc.). I would like to change this a bit to allow a user to capture only an item they choose. I was thinking along the lines of a right-click menu/invoke node combination, but cannot seem to find the right method to use in the node. If anyone has any suggestions or knows of a tutorial I could look at, your input is much appreciated.
 
 
0 Kudos
Message 1 of 10
(3,919 Views)
I assume that you want to modify this to get an image of a specific control/indicator?  The method involved can be gotten to by right clicking on any control/indicator ->Create Invoke Node -> Get Image.  This creates a node specific to that control... So on the diagram, right click on the node -> Disconnect from control. Then right -click again Select class -> VI Server -> Generic ->Gobject -> Control -> Control.  This will make the node generic... (YES, I know there are many ways to accomplish this for you hecklers).  You will need to get references to the controls on the front panel, You can discretely place them down, or use vi server to do this and grab it by name (and probably other methods as well).  Then you will have it.
As for the context menu.  Well you can search the forums for how to do that.  There is a toolkit and other mechanisms for simulating that, but it requires you to code it.  Hope this helps a bit.

Paul
Message 2 of 10
(3,905 Views)


@God's Templar wrote:
... I would like to change this a bit to allow a user to capture only an item they choose....
What's an "item"?
 
Do you want the user to be able to capture the image of a selected front panel item or do you want the user to choose which array element should contain the new image?
 
First of all, one of the worst ideas is to give two different controls the same label "#1", making it nearly impossible to distiguish which event case belongs to which control. This needs to be fixed first! Use descriptive names for control labels ("stop" and "capture" for example).

Message Edited by altenbach on 08-14-2007 09:02 AM

Message 3 of 10
(3,905 Views)
Hi,

There is a nice example you should have a look at, it's called "Run-Time shortcut Menus". To find it, launch the example finder : Helps >> Find examples... >> select the "search" tab and look for "menu"

Hope this helps

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 4 of 10
(3,897 Views)
Thank you all for the information. (Altenbach: I changed those labels, thanks for pointing that out.) Sorry for a non-technical term like "item", I was just unsure what word to use. The VI should allow the user to capture an image of anything they choose. A control, indicator, popup window, whatever is active. The only constraint is that the user's choices will be limited to *objects(?)* generated by the VI itself. This is why I was thinking a context menu would be the best way to approach this.
0 Kudos
Message 5 of 10
(3,878 Views)
You might wish to check out the code capture tool. It doesn't do exactly the same thing that you do, but it shows the concept and it also shows interacting with the clipboard. If you use the mouse input VIs, you can monitor clicks anywhere in the screen by polling and then simulate a PrintScreen click to take a screenshot, which you can then get as an image cluster by using the private Application class method Get Clipboard Image. If you want to learn about private methods, check out the LAVA forums' VI Scripting forum.
 
Note - I would probably not go with this solution for several reasons, but it just shows you that it can be done.

___________________
Try to take over the world!
Message 6 of 10
(3,870 Views)

This hit me while working on the VI. I figured most people here would think it was funny.

One node to rule them all, one node to find them, one node to bring them all, and in the cluster bind them.

 

Message Edited by God's Templar on 08-15-2007 10:57 AM

0 Kudos
Message 7 of 10
(3,848 Views)
And the traveller found the masters of the art, and knew progress once more.
 
Thanks everyone!
0 Kudos
Message 8 of 10
(3,825 Views)

Out of curiosity, how is it that people can post .png images withing their body of text.

I know you attach the image as a .png image, then go back and edit the message, using the newly created attachment for the hyperlink.

But how do you make the image display within the message? 

Cory K
0 Kudos
Message 9 of 10
(3,487 Views)

This is a test to see if I can display the image

 
 
 
 
 
 
 
 
 
Message Edited by Cory K on 09-26-2008 03:59 PM
Message Edited by Cory K on 09-26-2008 04:00 PM
Message Edited by Cory K on 09-26-2008 04:01 PM
Message Edited by Cory K on 09-26-2008 04:01 PM
Cory K
0 Kudos
Message 10 of 10
(3,483 Views)