画面全体の写真を撮るためにこの VB.NET コードを作成しましたが、代わりに焦点を合わせた領域の写真しか撮れません。どうしてこれなの?
Public Function SaveScreen(ByVal theFile As String) As Boolean
Try
SendKeys.Send("{PRTSC}")
Application.DoEvents()
Dim data As IDataObject = Clipboard.GetDataObject()
If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
Dim bmp As Bitmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Bitmap)
bmp.Save(theFile, Imaging.ImageFormat.Png)
End If
Clipboard.SetDataObject(0) 'save memory by removing the image from the clipboard
Return True
Catch ex As Exception
Return False
End Try
End Function