-1
A
回答
3
如果「採取截圖」你的意思是「送PrtSc鍵」,然後有一個更好的辦法,用System.Drawing.Graphics.CopyFromScreen
:
using(Bitmap b = new Bitmap(this.ClientSize.Width, this.ClientSize.Height)) {
using(Graphics g = Graphics.FromImage(b)) {
g.CopyFromScreen(this.PointToClient(Point.Empty), Point.Empty, this.ClientSize);
}
// Your form is now rendered into b.
}
如果要包括邊界,只需使用Size
代替ClientSize
和this.Location
而不是this.PointToClient(Point.Empty)
。
或者,你可以使用this.DrawToBitmap
:
using(Bitmap b = new Bitmap(this.Width, this.Height)) {
this.DrawToBitmap(b, new Rectangle(0, 0, this.Width, this.Height));
// Your form is now rendered into b.
}
這會工作,即使你的形式不具有焦點。但是,如果Aero處於活動狀態,它將繪製邊框並以Windows Basic樣式繪製。
-1
不,這是不可能捕捉到視覺的形式作爲比是通過某種screenshotting庫(如果這就是你在問什麼)的提供的其他圖像。
相關問題
- 1. C++ windows窗體中的字體渲染
- 2. 渲染窗體到位圖
- 3. 窗體不渲染
- 4. Zend子窗體視圖腳本渲染
- 5. Android-圖像渲染
- 6. C#窗口渲染PHP
- 7. C#的渲染圖
- 8. 渲染TIF圖像與JAI
- 9. Hadoop和3d渲染圖像
- 10. 將LaTeX渲染爲圖像
- 11. 將HTML渲染爲圖像
- 12. 從MySQL數據庫圖像渲染
- 13. 從BASE64渲染圖像中golang
- 14. 將字體從閃存渲染到圖像
- 15. Xamarin窗體(安卓項目)使用Skia圖形庫的錯誤渲染圖像
- 16. C#窗體 - 載入圖像
- 17. 窗體渲染自定義symfony2
- 18. Yii2 - 渲染窗體內頁腳(main.php)
- 19. Symfony 3覆蓋默認窗體渲染
- 20. 我不想渲染窗體標籤
- 21. 在Libgdx中渲染圖像
- 22. 用nodejs渲染圖像
- 23. SmartGWT慢速圖像渲染
- 24. 圖像渲染問題
- 25. Safari圖像渲染錯誤
- 26. Flying-Saucer/iText圖像渲染
- 27. 圖像渲染問題
- 28. 球拍圖像渲染
- 29. 圖像渲染測試
- 30. 圖像不是渲染