Код: Выделить всё
// System.Drawing.Point mpWF contains window-based mouse coordinates
// extracted from LParam of WM_MOUSEMOVE message.
// Get screen origin coordinates for WPF window by passing in a null Point.
System.Windows.Point originWpf = _window.PointToScreen(new System.Windows.Point());
// Convert WPF doubles to WinForms ints.
System.Drawing.Point originWF = new System.Drawing.Point(Convert.ToInt32(originWpf.X),
Convert.ToInt32(originWpf.Y));
// Add WPF window origin to the mousepoint to get screen coordinates.
mpWF = originWF + new Size(mpWF);
Я попытался деконструировать последнее утверждение следующим образом:
Код: Выделить всё
System.Drawing.Point tempWF = (System.Drawing.Point)new Size(mpWF);
mpWF = originWF + tempWF; // Error: Addition of two Points not allowed.
Подробнее здесь: https://stackoverflow.com/questions/329 ... ing-points