【发布时间】:2014-05-05 18:37:53
【问题描述】:
我有 2 个表格。
- Form 1 包含我需要截图的内容
- 表格 2 包含图形绘制(此表格始终在顶部但透明)。
我需要对第一个表单进行屏幕截图,但不要将其放在表单 2 的顶部,也不要包含表单 2 中的内容。
这是我正在处理的一些问题,我正在尝试修复。
Private Function TakeScreenShot(ByVal Control As Control) As Bitmap
Dim Screenshot As New Bitmap(Control.Width, Control.Height)
Control.DrawToBitmap(Screenshot, New Rectangle(0, 0, Control.Width, Control.Height))
Return Screenshot
End Function
这个函数不起作用,因为 Control.drawtoBitmap 没有设置 IMG 的值。
IMG 为空白并以纯白色图像返回。
这个函数的调用是this
TakeScreenShot(form1.webbrowser1).Save("c:\Screenshot.png",
System.Drawing.Imaging.ImageFormat.Png)
我们将不胜感激。
【问题讨论】:
标签: vb.net forms bitmap controls screenshot