连续截屏而不减慢电脑速度 - C#

发布于 2024-12-12 02:45:21 字数 576 浏览 0 评论 0原文

我必须为我的程序每 250 毫秒连续捕获一次屏幕截图(类似于 Netmeeting)。我使用了以下代码:

Image CaptureScreenShot()
{
    bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
    gfxScreenshot = Graphics.FromImage(bmpScreenshot);
    gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
    return bmpScreenshot;
}

捕获屏幕截图,但它会降低 PC 的性能。其中,Netmeeting 没有。 有没有办法在不降低电脑速度的情况下获得屏幕截图? 代码示例将不胜感激

I have to capture a screen shot continuously after every 250 milliseconds for my program (Similar to Netmeeting). I used the following code:

Image CaptureScreenShot()
{
    bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
    gfxScreenshot = Graphics.FromImage(bmpScreenshot);
    gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
    return bmpScreenshot;
}

To capture the screenshot but it slow the performance of the PC. Where, Netmeeting do not.
Is there any way to get screen shot without slowing the PC?
Code sample will be appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不寐倦长更 2024-12-19 02:45:21

您在这里找不到基本的答案。他们使用更多复杂的机制来检测屏幕上的变化并发送它们。
查看终端 svc 的工作原理 -
http://technet.microsoft.com/en-us /library/cc755399%28WS.10%29.aspx

理想情况下,您可以连接 GUI 并监视事件等,这比简单的屏幕抓取要高级得多。如果您想查看不太高级的代码,请查看 http://www.tightvnc.com

You won't find a basic answer here. They use much more involved mechanisms for detecting changes on the screen and sending them.
Check out how terminal svcs work -
http://technet.microsoft.com/en-us/library/cc755399%28WS.10%29.aspx

ideally you are hooking into the GUI and monitoring events, etc. much more advanced than simply screen scraping. If you want to look at less advanced code check out http://www.tightvnc.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文