05-23-2016 02:39 PM - edited 05-23-2016 02:49 PM
Hello,
I am trying to get the pixel coordinates from an Imaq image based on a mouse-click event, similar to this post and this post. The problem is that with the first post, I get the coordinates within the image control frame and am hesitant to trust them, these seem to have the origin centered, can return negative coordinates, and do not represent the actual size of the detector I am using (512x512). It also returns coordinates outside of the actual data when the image control frame is clicked. The second method simply returns null coordinates. What I want are the pixel coordinates displayed when hovering the mouse over the imaq image control frame.
What baffles me is that I have tried to the second method with a stock png file and it works fine, it is only when I create an image from my camera's data that the coordinates are returned null. Note the camera data displays in the image control frame just fine.
Any ideas would be helpful. Attached is a picture of the offending code and the front panel to show the camera data is coming in (I know it needs some cleaning).
Thanks,
Tyler
Solved! Go to Solution.
05-23-2016 03:24 PM
for better help you have to send your vi
but I think this example vi is your solution
check this vi
05-23-2016 04:57 PM
I was able to figure it out. I had to use the correct imaq selection tool... It seems the selection tool does not fire the event, switching to the point tool does. I am using a non-imaq compatible camera that makes use of a dll for retrieving the data so my vi won't be of much use. Let me know you would like it still though. I also tried the 'Get Last Mouse Position' property node nested in a mouse click event structure that seemed work. Thanks for the help hatef.
05-24-2016 07:42 AM
A basic vi showing the functionallity it attached.
05-24-2016 08:03 AM
05-24-2016 08:21 AM
I am not sure the distinction you are making. I added both to the attached vi and saved for labview 2014. 'Get last mouse position' tracks the the pixel coordinates displayed by the imaq image control (what I want) regardless if the image is oversized (has scroll bars) or undersized and does not fill the image control area. 'Get last event' only fires if the imaq point tool is selected (at least for the 'click event' I have specified for the invoke node.
05-08-2017 07:36 PM
Would you please convert this example to LV2011 as well? Thank you.
05-09-2017 05:24 PM
Here you go!
05-10-2017 10:20 AM
You beat me to it, thanks G-IV!
05-10-2017 10:22 AM