将屏幕捕获到位图中我想在我的代码中捕获屏幕以获取图像 - 就像使用键盘上的“打印屏幕”按钮一样。有谁知道如何做到这一点?我没有起点。
3 回答
翻阅古今
TA贡献1780条经验 获得超5个赞
// Use this version to capture the full extended desktop (i.e. multiple screens)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);
- 3 回答
- 0 关注
- 389 浏览
添加回答
举报
0/150
提交
取消