05-21-2019 12:21 AM
Hi
I need to get the pixel a user clicks on in my IMAQ image. We are not using an IMAQ camera. Our old method had to do a lot of maths with co-ordinates on mouse click, image position and working out relative positions.
This example is exactly what I want to do, and works on my computer beautifully.
As my image is in a VI in a subpanel I wrapped the above example in a subpanel and it still works.
However when I try to use this in my application it doesn't work with the mouse up event.
My image size is 1280 x 1024.
The point click event returns one of 4 values pairs depending on the quadrant clicked [0,0] [640,0] [0,511] or [640,511]. Interesting this is 1/2 image size.
Mouse location returns corrects co-ordinates. Zoom tool returns correct co-ordinates. So not sure what is wrong.
Any suggestions?
I will use mouse location in the meantime as its probably close enough, but it would be nice to know why the coordinates event is not working.
LabVIEW 2018.
Cheers
05-21-2019 03:47 PM
Confirmed its not due to IMAQ Array to Image... which is how I am loading the camera data in the program.
Display image is the only control with a mouse event in my application. So can't see how other events should be confusing it.
05-22-2019 09:53 AM
Let's try to check this forum:
I think it's very helpful in this situation
05-22-2019 03:12 PM
thanks @capuy for suggestion. I had found that thread, and I have re-read / tried their code again for clues, but I can't see anything helpful there for my issue.
Its seems the issue there was the OP was looking for events from selection tool vs point tool. I definitely have point tool selected and click events for point tool. Scrolling works fine.
As mentioned I am following the example - and I modified the example to match my application by using it in a subpanel and without IMAQ camera. Was still ok.
After some testing the Last Mouse Position is more accurate than what we had, but I think it would be better to use the event coordinates if I could get it working properly.
05-30-2019 02:05 AM