I need this information to position floating UI elements around other Eto controls. Control.PointToScreen uses a coordinate system with its origin situated below the Windows menu bar, which results in an offset in relation to the parent Eto control.
I currently do this:
var controlToLogicalScreen = ControlToDockTo.PointToScreen(dockingLocation);
var logicalScreenToNativeScreen = EtoHelpers.LogicalToScreen(controlToLogicalScreen );
var screenToAbsolute = new Point(OffsetPoint(logicalScreenToNativeScreen ));
var absoluteToLogical = new Point(EtoHelpers.ScreenToLogical(logicalToScreen));
Where LogicalToScreen
and ScreenToLogical
are methods suggested by @curtisw in this thread:
and OffsetPoint
is a method using user32.dll
to find the ClientRectangle
of the main Rhino window.
RhinoView
gives us access to ScreenRectangle
, which can be nicely translated to Eto’s logical screen coordinates. Is there a similar way of retrieving true screen coordinates of Eto controls?
@CallumSykes, @dale, maybe you can help?