LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to continuously receive x/y coordinates when selected from an image

Hi, I am looking on how to receive the x/y coordinates when a user selects a point on an image.  The code that I've come up with so far works, but not to my requirements.  The code attached below, pops up a window and the user selects the point, then the coordinates are displayed.  This causes two problems, it is not continuous.  What I mean by that, is that I wish to allow the user to keep clicking on random points of the image and have the coordinates displayed.  Also, I do not wish to have a popup window, the user would select the points right on top of the image on the front panel.  Please let me know if you can think of a way to do this.

 

The other image displayed below is for reference.  I wish to have parts of the image arranged in some sort of pattern for the user to select.

 

Thank you!

Download All
0 Kudos
Message 1 of 5
(2,957 Views)

Hi Robot,

 

Check this. Is this you want?

---
Silver_Shaper | CLD
0 Kudos
Message 2 of 5
(2,937 Views)

@sac. wrote:

Hi Robot,

 

Check this. Is this you want?


Hi SaC,


Thank you! It is very very close... all I need would be for the user's mouse click to activate the x/y points to be used. I revised your code to show that I'll be using the x/y points to run different cases. Right now, I just used the x coordinate for an example. However, I would only like these cases to be run if the mouse has been clicked. I tried using the Activate Mouse and Aquire Input Data VIs, but they only return the x/y points from the whole monitor, not just over the image. Any ideas?

 

0 Kudos
Message 3 of 5
(2,923 Views)

@R0B0T wrote:

@sac. wrote:

Hi Robot,

 

Check this. Is this you want?


Hi SaC,


Thank you! It is very very close... all I need would be for the user's mouse click to activate the x/y points to be used. I revised your code to show that I'll be using the x/y points to run different cases. Right now, I just used the x coordinate for an example. However, I would only like these cases to be run if the mouse has been clicked. I tried using the Activate Mouse and Aquire Input Data VIs, but they only return the x/y points from the whole monitor, not just over the image. Any ideas?

 


Actually, I found a way to have LV do what I want. I experimented around with the Activate Mouse and Aquire Input Data VIs.  Check it out and let me know if you think this is a good way of doing it.

 

0 Kudos
Message 4 of 5
(2,914 Views)

Hey robot,

This might be a good idea of doing.Try to avoid red dots in divide function replacing with quotient and remainder function. Post your final code so that can help you much better.

---
Silver_Shaper | CLD
0 Kudos
Message 5 of 5
(2,903 Views)