10-10-2013 01:22 PM
I have an application where I'd like the user to be able to interact with objects drawn in a 2D picture control using the mouse. In order to do this, I need to translate between screen coordinates, which are passed with the mouse events, and coordinates in the 2D picture control.
The problem I'm running into is that I can't find a way to determine the screen coordinate of the upper left hand corner of the 2D picture control's drawing/client area. I tried using the picture control's "Position" property, but this results in an offset due to the difference between the upper left hand corner of the picture control (including the label, etc.) and the upper-left hand corner of the drawing area. See attached VI.
Does anybody know how to get the screen coordinate of the corner of the picture control's drawing area?
Mark Moss
Solved! Go to Solution.
10-10-2013 01:31 PM
I tend to use the Mouse property of the picture control to get the position. Deals with things like the origin shift for you.
10-10-2013 01:51 PM
10-10-2013 02:17 PM
Thanks, the Mouse Position property does exactly what I need.