简单的C#应用​​程序共享界面 [英] Simple C# Screen sharing application

查看:157
本文介绍了简单的C#应用​​程序共享界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待建立在C#中一个非常基本的屏幕共享应用程序。没有必要的远程控制。我只是希望用户能够播放他们的屏幕到网络服务器。

I am looking to create a very basic screen sharing application in C#. No remote control necessary. I just want a user to be able to broadcast their screen to a webserver.

我应该如何实现呢? (在正确的方向指向任何将不胜感激)。

How should I implement this? (Any pointer in the right direction will be greatly appreciated).

它并不需要很高的FPS。将足以甚至更新曾经5秒左右。你是否认为这将足以只需上传截图曾经5秒钟,我的Web服务器?

It does NOT need to be high FPS. Would be sufficient to even update ever 5s or so. Do you think it would be sufficient to just upload a screenshot ever 5 seconds to my web server?

推荐答案

我在前面的博客上讲述< A HREF =htt​​p://brianbondy.com/blog/id/87/how-vnc-fog-creek-copilot-and-other-remote-control-software-works>远程屏幕共享软件是如何在这里工作,它不是专门针对C#,但它提供了有关专题的好基本的了解。在那篇文章中还挂是远程帧缓存测试,这也可能会想上阅读了。

I previously blogged about how remote screen sharing software works here, it is not specific to C# but it gives a good fundamental understanding on the topic. Also linked in that article is the remote frame buffer spec which you'll also probably want to read up on.

基本上你将要采取的截图,你可以发送这些屏幕截图和在另一侧显示它们。你可以保留最后的屏幕截图和比较块的截图中看到您需要发送该截图块。发送数据之前,您通常会做一些压缩。

Basically you will want to take screenshots and you can transmit those screenshots and display them on the other side. You can keep the last screenshot and compare the screenshot in blocks to see which blocks of the screenshot you need to send. You would typically do some sort of compression before sending the data.

要具有遥控器,你可以跟踪鼠标移动和传输,并设置在另一端的指针位置。也同上约按键。

To have remote control you can track mouse movement and transmit it and set the pointer position on the other end. Also ditto about keystrokes.

至于那张压缩在C#中,你可以简单地使用的JpegBitmapEncoder 来创建具有JPEG压缩与所需的质量您的截图。

As far as compression goes in C#, you can simply use JpegBitmapEncoder to create your screenshots with Jpeg compression with the quality that you want.

JpegBitmapEncoder encoder = new JpegBitmapEncoder();
encoder.QualityLevel = 40; 

要比较你可能是最好的旧块和新上创建一个哈希文件块,然后检查,看看他们是相同的。您可以使用你想为这个任何哈希算法。

To compare file blocks you are probably best to create a hash on the old block and the new one, and then check to see if they are the same. You can use any hashing algorithm you want for this.

这篇关于简单的C#应用​​程序共享界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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