Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Public Sub HandleDesktopInfo(ByVal client As ServerClient, ByVal bytes As Byte())
  2. If PictureBox1.Image IsNot Nothing Then
  3. PictureBox1.Image.Dispose())
  4. End If
  5.  
  6. Dim ms As New IO.MemoryStream(bytes)
  7. Dim bmp = New Drawing.Bitmap(ms)
  8. PictureBox1.Image = bmp
  9.  
  10. ms.Dispose()
  11. fps += 1
  12. End Sub
  13.  
  14. If PictureBox1.Image IsNot Nothing Then
  15. PictureBox1.BeginInvoke(Sub() PictureBox1.Image.Dispose())
  16. End If
  17.  
  18. Dim newimage As Bitmap = PictureBox1.Image
  19.  
  20. Dim ms As New IO.MemoryStream(bytes)
  21. Dim bmp = New Drawing.Bitmap(ms)
  22. PictureBox1.Image = bmp
  23.  
  24. ms.Close()
  25. ms.Dispose()
  26.  
  27.  
  28.  
  29. If newimage IsNot Nothing Then
  30. newimage.Dispose()
  31. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement