Home › Forums › Software Development › Converting to client coordinates › Reply To: Converting to client coordinates

Hi Albin,
The ClientToScreen and ScreenToClient functions used in the EyeX SDK for C/C++ are Windows api functions:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183434%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/dd162952%28v=vs.85%29.aspx
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.