Private Sub PerformCapture()
Me.Visible = False
Dim dc1 As IntPtr = CreateDC("DISPLAY", Nothing, Nothing, CType(Nothing, IntPtr))
Dim g1 As Graphics = Graphics.FromHdc(dc1)
MyImage = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, g1)
Dim g2 As Graphics = Graphics.FromImage(MyImage)
dc1 = g1.GetHdc()
Dim dc2 As IntPtr = g2.GetHdc()
BitBlt(dc2, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, dc1, 0, 0, 13369376)
g1.ReleaseHdc(dc1)
g2.ReleaseHdc(dc2)
MyImage.Save("c:\Captured.jpg", ImageFormat.Jpeg)
Visible = True
MessageBox.Show("Finished Saving Image")
Me.SetBounds(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
firstCrop = True
End Sub
to upload image to sftp follow this link
sharpSsh - A Secure Shell (SSH) library for .NET[
^]