缩放鼠标位置 [英] Scaling mouse position

查看:85
本文介绍了缩放鼠标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[已决议]



您好,



我正在制作远程桌面程序为了用我的鼠标控制远程屏幕,我需要能够在考虑到我的表格大小的情况下发送正确的坐标。

更详细地说,我将把光标移到我的表格上并且我的鼠标位置将被发送到客户端,以便他们的鼠标可以移动。如果我的表单大小(300,300)和客户端的屏幕大小是(1281,761),如果我将鼠标移动到表格上的300,300,那么他们的鼠标应移动到1281,761,如果我将鼠标移动到150,150然后客户应该移动到~640,380。



有没有人有这方面的代码? (我无法解决它背后的数学问题)。要在我自己的计算机上测试这个,我将设置label1.location到客户端鼠标应该去的地方。



请帮忙!

[RESOLVED]

Hello,

I'm making a remote desktop program and in order to control the remote screen with my mouse i need to be able to send over the correct coordinates taking into consideration the size of my form.
In more detail, I will be moving my cursor over my form and my mouse position will be sent to the client so their mouse can move. If my form has the size (300,300) and the client's screen size is (1281,761), if i move my mouse to 300,300 on the form then their mouse should move to 1281,761, and if i move the mouse to 150,150 then the client's should move to ~640,380.

Does anyone have a code for this please? (I can't work out the math behind it). To test this on my own computer i'm settings label1.location to wherever the client mouse should go.

Please help!

推荐答案

请参阅我对该问题的评论。目前还不清楚哪个部分可能是你的问题。你可以看看这个问题显然已经解决的两个CodeProject工程:



使用C#.NET远程桌面 [ ^ ],

Palantir - 远程桌面管理器 [ ^ ]。



我特别喜欢第二个,Palantir,正是因为你所关心的问题。前段时间,我准备了演示文稿,并在两台计算机上遇到了不同屏幕尺寸的问题。我发现Microsoft Windows RDP客户端未能很好地解决问题,但令我惊讶的是,Palantir应对了这个问题。所以,请检查一下。



-SA
Please see my comments to the question. It's not really clear which part could be your problem. You can take a look at two CodeProject works where this problem is apparently solved:

Remote Desktop using C#.NET[^],
Palantir - Remote Desktop Manager[^].

I especially like the second one, Palantir, and exactly because of the problem related to the one you are concerned with. Some time ago, I prepared the presentation and faced the problem of different screen sizes on two computers. I found that Microsoft Windows RDP client failed to solve the problem nicely, but, to my surprise, Palantir coped with it. So, please check it out.

—SA


这篇关于缩放鼠标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆