send picturebox1.image via web

frix199

Member
Joined
Jul 18, 2005
Messages
19
Programming Experience
1-3
Hello All!!

well, the title speaks himself....
i hav some client app. and one server...
i want, in every second, the picturebox1.image to be sended from every client to the server....

well, i know it's difficult but plz help me :S

i got really stuk here:mad:

thank u every1 !!!!!!
 
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] ic [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] ImageConverter = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] ImageConverter
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] b() [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Byte[/COLOR][/SIZE][SIZE=2] = ic.ConvertTo(PictureBox1.Image, b.GetType())
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] wc [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Net.WebClient = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Net.WebClient
wc.UploadData(webAddress, b) 'webAddress is the URL you will be uploading to
[/SIZE]

If you are going to do this every second, you may need to use multiple threads.
 
You know what... I just tried that and it didn't work for me. This worked instead:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] b [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Byte[/COLOR][/SIZE][SIZE=2]()
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] ms [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] IO.MemoryStream = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] IO.MemoryStream
PictureBox1.Image.Save(ms, Imaging.ImageFormat.Jpeg) 'Or whatever ImageFormat you are using
b = ms.ToArray
[COLOR=#0000ff]Dim[/COLOR][SIZE=2] wc [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Net.WebClient = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Net.WebClient
wc.UploadData(webAddress, b)[/SIZE]
[/SIZE]

 
Back
Top