將屏幕捕獲到位圖中我想在我的代碼中捕獲屏幕以獲取圖像 - 就像使用鍵盤上的“打印屏幕”按鈕一樣。有誰知道如何做到這一點?我沒有起點。
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 關注
- 426 瀏覽
添加回答
舉報
0/150
提交
取消
