所以我找不到任何东西可以帮助我解决这个问题,这让我发疯了。
使用Windows Input Simulator (C# SendInput Wrapper - Simulate Keyboard and Mouse)
当我的软件的用户碰巧有一个非标准的 100% 窗口缩放InputSimulator.Mouse.MoveMouseTo(toX, toY);
被抛出,移动到一个不正确的位置。
我目前的计算方式:
int toX = (int)((65535.0f * (newX / (float)screen.Bounds.Width)) + 0.5f);
int toY = (int)((65535.0f * (newY / (float)screen.Bounds.Height)) + 0.5f);
例如,如果用户将缩放设置为 125%,我将如何计算正确的 100% 缩放位置?
提前致谢。