Author Topic: [VB] Get Screenshot  (Read 721 times)

0 Members and 1 Guest are viewing this topic.

Offline iiCE

  • /dev/null
  • *
  • Posts: 8
  • Cookies: 6
    • View Profile
[VB] Get Screenshot
« on: June 21, 2015, 01:58:01 am »
Simple Screenshot application.

Code: [Select]
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim Img As New Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
        Dim g As Graphics = Graphics.FromImage(Img)
        g.CopyFromScreen(0, 0, 0, 0, Img.Size)

        Img.Save("image.jpg")

        g.Dispose()
        Me.Close()

    End Sub
End Class

Enjoy :-P