04-29-2013 02:17 PM
04-29-2013 04:27 PM
I don't know about the IMAQ image control, but the 2D Picture control has a Mouse property, which gives the current X and Y position of the mouse. Could you place a transparent Picture on top of your image control and use the coordinates that way?
04-29-2013 05:16 PM
04-30-2013 06:42 AM
Hi,
I am confused why you get the mouse position one click in the past because it seems to work ok for me. I've had to use four of the image properties to recreate the effect using the mousemove event, but this seems to give the same values as the Last Mouse Position property so I think it does what you want. I couldn't see an origin property so I did the conversion using the position given at the image center. I wanted to post a snippet here but I'm new to posting and couldn't seem to get it to work for the whole block diagram, so I'm using a screenshot instead. I hope this helps in some way.
Will
04-30-2013 07:20 AM
@Polyphemus wrote:
[...] get the mouse position one click in the past [...]
To avoid this time-lag I guess you are supposed to force the event structure do run once, without a user triggered event; therefore you can use the property node "value" and "value signalling (SGL)"
in the time-out frame of the event structure
Unfortunately I can't test this with your code as I don't have IMAQ on this PC.
04-30-2013 08:51 AM
I suspect that because you are using mouse move, which is constantly updating, last mouse position works reasonably well. I'm using mouse down, as I only want things to happen when I click and last mouse position definitely gives me where the mouse was when I last clicked. I'm marking a grid and it is definitely the previous grid point that last mouse position returns. On the plus side, image centre does seem to return the point of the larger underlying image at the display centre, so using that I could figure out where in the larger image I'm working. That's somewhat nicer than getting the co-ords from the image information string and converting them, which is what I was reduced to doing. I still don't see why there isn't a current mouse position feature that gives co-ords in terms of the underlying image as last mouse position does.
Another little item that isn't clear to me is why the underlying IMAQ image lists mouse operations under its events. They don't fire when you are working on the displayed image.
Finally, I discovered the hard way that the mouse events still fire even when you are over the ROI toolbox, so clicking to change a tool causes the mouse down event to fire. Dumb! Fortunately easy ro fix by checking whether the mouse is inside the dispaly area, but still dumb.
12-09-2013 08:39 PM
@Greg_at_NI wrote:
I don't know about the IMAQ image control, but the 2D Picture control has a Mouse property, which gives the current X and Y position of the mouse. Could you place a transparent Picture on top of your image control and use the coordinates that way?
"place a transparent Picture on top of your image control"but how?
12-10-2013 04:32 AM
@cathy345 wrote:
"place a transparent Picture on top of your image control"but how?
hi,
I would do this:
1# right-click frontpanel>modern>graph>elements>2d picture
2# tools palette>brush-tool>transparent color
there's also this entry in the online-help
http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/creating_transparent_objec/
Regards,
Alex