如何每隔10秒拍摄一次屏幕捕获窗口 [英] how to take Screen Capture window for every 10 seconds
本文介绍了如何每隔10秒拍摄一次屏幕捕获窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何每隔10秒拍摄一次窗户的屏幕截图。如果我点击按钮它应该连续10秒的窗口截屏,然后它应该停止。
解决方案
Bitmap screenshot =新的位图(SystemInformation.VirtualScreen.Width,
SystemInformation.VirtualScreen.Height,
PixelFormat.Format32bppArgb);
Graphics screenGraph = Graphics.FromImage(screenshot);
screenGraph.CopyFromScreen(SystemInformation.VirtualScreen.X,
SystemInformation.VirtualScreen.Y,
0,
0,
SystemInformation.VirtualScreen.Size,
CopyPixelOperation.SourceCopy);
screenshot.Save(Screenshot.png,System.Drawing.Imaging.ImageFormat.Png);
这可能会覆盖整个屏幕。你也可以看一下: [ ^ ]
我希望这个帮助。
一个简单的谷歌搜索截屏c#codeproject [ ^ ]可以提供有关所请求问题的大量信息。
使用计时器每10秒钟获取一次图像,并使用@ChrisCreateBoss先生编写的代码
how to take screen shots of the windows for every 10 seconds. if i click on the button it should take screen shot of the windows continuously for 10 seconds and then it should stop.
解决方案
Bitmap screenshot = new Bitmap(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height, PixelFormat.Format32bppArgb); Graphics screenGraph = Graphics.FromImage(screenshot); screenGraph.CopyFromScreen(SystemInformation.VirtualScreen.X, SystemInformation.VirtualScreen.Y, 0, 0, SystemInformation.VirtualScreen.Size, CopyPixelOperation.SourceCopy); screenshot.Save("Screenshot.png", System.Drawing.Imaging.ImageFormat.Png);
This might cover the entire screen. You can check out this too: [^]
I hope this helps.
A simple google search screen capture c# codeproject[^] can provide you ton of information on the requested question.
use timer to get image in every 10 seconds and use the code which is written by Mr. @ChrisCreateBoss
这篇关于如何每隔10秒拍摄一次屏幕捕获窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文