因此,我正在爲物理治療環境編寫一個文檔程序,並試圖將出口帶有其上的數據的表單導入到某種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) –