在所有操作系统中,每5分钟自动拍摄屏幕截图
我正在使用Avalonia开发一个跨平台桌面应用程序,其中我想在每5分钟后进行一次桌面的屏幕截图。通过谷歌搜索,我可以在Windows OS中获取屏幕快照。
Rectangle bounds = Screen.GetBounds(Point.Empty);
using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using(Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
}
bitmap.Save("test.jpg", ImageFormat.Jpeg);
}
但是我该如何在Linux和Mac OS中进行操作。 任何人,请帮助我。
I'm developing a cross-platform desktop application using Avalonia, in which I want to take screenshots of the desktop after every 5 min. By googling I get the code to take screenshot in windows OS.
Rectangle bounds = Screen.GetBounds(Point.Empty);
using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using(Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
}
bitmap.Save("test.jpg", ImageFormat.Jpeg);
}
But how can I do it in Linux and Mac OS.
Anyone please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论