Advertisement
Guest User

Untitled

a guest
Mar 13th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.96 KB | None | 0 0
  1.     Private ScreenShot As Thread
  2.  
  3.     Private Sub Capt_Click(sender As Object, e As EventArgs) Handles Capture.Click
  4.         CheckForIllegalCrossThreadCalls = False
  5.  
  6.         Form2.Show()
  7.  
  8.         ScreenShot = New Thread(AddressOf RefreshView)
  9.         ScreenShot.IsBackground = True
  10.         ScreenShot.Start()
  11.  
  12.     End Sub
  13.  
  14.     Private Sub RefreshView()
  15.  
  16.         Dim Size As Rectangle
  17.         Dim Capt As System.Drawing.Bitmap
  18.         Dim Pic As Graphics
  19.  
  20.         Do While 1
  21.             Size = Form2.RectangleToScreen(Form2.ClientRectangle)
  22.             Capt = New System.Drawing.Bitmap(Size.Width, Size.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
  23.             Pic = Graphics.FromImage(Capt)
  24.             Dim boundsLeft = Size.X
  25.             Dim boundsTop = Size.Y
  26.             Pic.CopyFromScreen(boundsLeft, boundsTop, 0, 0, Size.Size, CopyPixelOperation.MergeCopy)
  27.             PictureBox1.Image = Capt
  28.         Loop
  29.  
  30.     End Sub
  31.  
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement