LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image control mouse move event updates

I would like to drag the ROI around in the Image control (holding down the left mouse button) and continually read out the ROI coordinates. I can't find a way to do this: the mouse move event does not seem to fire if I hold the left mouse button down. I assumed that I would have
 
1. Mouse down when I click and hold.
2. Mouse move when I move the ROI around.
3. Mouse up when I release the left mouse button.
 
This does not seem to be the case.
 
I've done a simple workaround which is
 
1. Use the key up event to check that the space bar has been pressed.
2. Use this to toggle a "lock" boolean which locks the target to the mouse coordinates.
3. Use the mouse move event to return the Image Control Mouse Coordinates property.
4. Unlcok the target from the mouse coordinates by pressing the space bar again.
 
This kind of works, but it is much less intuitive than the standard windows "click and drag".
 
Any comments appreciated.
 
Thanks.
 
PS The Image Control is excellent, it has saved me lots of development time. Also, the ROI tools are hugely useful.
 
0 Kudos
Message 1 of 2
(2,698 Views)
If you filter the mouse down event (MOUSE DOWN?) then the coordinated are always returned on mouse move event weather the mouse is down or not.  I did get the coordinates when the left button was down anyway it was just when the right button was down which the move event was not handled (due to the popup menu consuming the event first?)  I thing there is a good way to do this with dynamic event registration, and NI has a similar example of drag and drop of controls, but I am not at my LV machine to look for it right now.  If I am wrong I am sorry it is early and my coffee is not brewed yet.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 2
(2,693 Views)