因此,我正在为物理治疗环境编写一个文档程序,并试图将出口带有其上的数据的表单导入到某种PDF或图像中。我的形式如下:VB.net导出为PDF格式
我曾尝试使用下面的代码创建映像从中
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmpScreenshot As Bitmap = New Bitmap(Width, Height, PixelFormat.Format32bppArgb)
' Create a graphics object from the bitmap
Dim gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)
' Take a screenshot of the entire Form1
gfxScreenshot.CopyFromScreen(Me.Location.X, Me.Location.Y, 0, 0, Me.Size, CopyPixelOperation.SourceCopy)
' Save the screenshot
bmpScreenshot.Save("C:\Student.jpg", ImageFormat.Jpeg)
End Sub
但每次它回来,因为只有形式的部分尝试。
任何帮助,将不胜感激!
我建议你放弃'Me.Size'和使用[Form.RestoreBounds](https://msdn.microsoft.com/en-us/library/system.windows.forms.form.restorebounds(v = vs.110).aspx) –