Home › Forums › Software Development › Converting to client coordinates › Reply To: Converting to client coordinates
The ClientToScreen and ScreenToClient functions used in the EyeX SDK for C/C++ are Windows api functions:
In the EyeX SDK for .Net the corresponding functions are tied to the specific GUI frameworks:
If you are using WPF, you can call “element.PointToScreen(point)” and “element.PointFromScreen(point)” on any element inheriting FrameworkElement to convert back and forth between client and screen coordinates. See WpfInteractor.GetElementBoundsInScreenCoordinates(…) for an example.
If you are using WinForms, you can call “control.PointToScreen(point)” and “control.PointToClient(point)” on any control inheriting from Control to convert back and forth between client and screen coordinates. See FormsInteractor.AddToSnapshot(…) for an example.
If you are using another GUI framework that framework probably has something similar to offer. Otherwise you will have to call the Windows api functions using pinvoke.