Added Imports System.Drawing.Imaging
Declare SnapDir as String
Dim SnapDir As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\Screenshot"
Remove the trailing \ from "\Screenshot\". Add "& ".jpg")" to screengrab.Save(SnapDir)
Took some of your code out, and plugged into a Command Button
Dim SnapDir As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\Screenshot" 'Try Dim screenshot As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height) Dim screengrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height) Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screengrab) g.CopyFromScreen(New Point(0, 0), New Point(0, 0), screenshot) MsgBox(SnapDir & "snap.jpg") 'ADDED TO SHOW DIR screengrab.Save(SnapDir & ".jpg") 'ADDED & ".jpg") MsgBox("your screen has been snapped and the snap was saved", MsgBoxStyle.Information, "ScreenShot") Me.Show()
(screenshot taken with this code found in Libraries\Documents)