简单,最简单的方法是将坐标转换为标准化形式(范围从0到1)。然后,您可以使用这些标准化的坐标来计算另一个分辨率上的mousePosition。这样设备就不需要知道其他设备的分辨率。
所以:
//First Normalize the clickPosition using the current resolution
//clickPos(200,300) and resolution(800,600) => normalized(0.25,0.5)
var normalized = clickPos/resolution;
//Now you can send this information to the other device
//The other device uses the normalized parameter to calculate the mouseClick with his resolution
//normalized(0.25,0.5) and otherResolution(1280,720) => otherDeviceClickPos(320, 360)
var otherDeviceClickPos = normalized * otherResolution;
这是否回答对您有帮助? http://stackoverflow.com/a/3922615/290343 –
_“我想用c#开发一个远程桌面应用程序”_ - [why](http://www.codeproject.com/Articles/43705/Remote-桌面使用C-NET)[重塑](http://www.realvnc.com/)[the wheel](http://www.teamviewer.com/)?您将遇到很多在这些产品中已解决并修复的问题。说实话,如果简单的数学和[手动](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousemove(v = vs.100).aspx)是一个问题,您将如何实施正在运行的远程桌面应用程序? – CodeCaster