Scusa ho letto solo ora!!
Anche a me non funzionava cosi' ho risolto in questo modo,non sono bravissimo con vb.net potrebbe essere anche sbagliato.Naturalmente ho trovato su internet quello che mancava.
Invio:
Private Sub invioimage()
Try
Dim ns As NetworkStream = Client.GetStream()
PictureBox1.Image.Save(ns, ImageFormat.Jpeg)
ns.Flush()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Ricevo:
Dim data() As Byte ' il data del client
Public Sub RiceivoImage()
Try
Dim s As New MemoryStream
Dim nws As NetworkStream = client.GetStream
Dim bytesRead As Integer = nws.Read(data, 0, client.ReceiveBufferSize)
s.Write(data, 0, bytesRead)
PictureBox1.Image = Image.FromStream(s)
Catch ex As InvalidOperationException
'---ignore this error---
Console.WriteLine(ex.ToString)
Catch ex As Exception
MessageBox.Show(ex.ToString)
Return False
End Try
Return
End Sub
Vorrei chiedere una cosa se posso intervenire,io devo spedire due immagini come posso fare?