Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private ScreenShot As Thread
- Private Sub Capt_Click(sender As Object, e As EventArgs) Handles Capture.Click
- CheckForIllegalCrossThreadCalls = False
- Form2.Show()
- ScreenShot = New Thread(AddressOf RefreshView)
- ScreenShot.IsBackground = True
- ScreenShot.Start()
- End Sub
- Private Sub RefreshView()
- Dim Size As Rectangle
- Dim Capt As System.Drawing.Bitmap
- Dim Pic As Graphics
- Do While 1
- Size = Form2.RectangleToScreen(Form2.ClientRectangle)
- Capt = New System.Drawing.Bitmap(Size.Width, Size.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
- Pic = Graphics.FromImage(Capt)
- Dim boundsLeft = Size.X
- Dim boundsTop = Size.Y
- Pic.CopyFromScreen(boundsLeft, boundsTop, 0, 0, Size.Size, CopyPixelOperation.MergeCopy)
- PictureBox1.Image = Capt
- Loop
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement