It is file transfer .. almost
A Picture in a picture box is just a series of bytes which of course you can send via winsock. A file is also just a series of bytes and if you know how to do this then it would appear to be straight forward right?
Well not quite. If you took the file transfer method and made your picturebox first save it's image to a file, then transfer the file to the other end, then read it into the recieving picturebox, you would have a working solution that provides you everything you aksed for.
If you want to do it without files, then you need to get into the guts of what a DIB is. All bitmaps when read into a pictureBox end up being stored as a Device Independent Bitmap in memory. SO you need to know how to access this DIB data from code and send/recieve it.
I've done all that with help from the excellent type libraries on http://vbaccelerator.com/ I haven't used winsock though but I believe it would be straight forward enough for someone who knows all the ins and outs of winsock.
One point you might like to remember though: Consider a 156k bitmap (bmp) that you save as a jpg. The jpg ends up at say 20k. You know you have lost some image quality but because of the huge reduction in size, you can live with it. Sound familiar? Well once it's in memory as a DIB, guess what? It's back up to 156k again. So if you end up going ahead and using winsock to send the data, you'll either have to live with the fact that you are sending almost 8 times the number of bytes that you really need to send, or come up with your own compression mechanism (perhaps these algorithms are publically known?).
In my opinion, saving to a file (jpeg) then sending the file or at least the bytes in the file, is a far better proposition.
I'll have a go at doing this myself, only I'm no winsock wiz so it could take me a while :)
Cheers
Where's the help when you need it??
I've been working on this problem for months now and with NO avail. When I set out to do this project I thought the transferring of the pictures in the pictureboxs would be the easy part. Boy was I wrong! I know its possible but yet I cant figure it out. Anyway, Mike if you hear of anything let me know. I will email you if I do.
Wish us luck,
Todd
I've got just what you need!
The code comes from chapter 21 of "Visual Basic Programmer's Library", By Christopher J. Bockman, Lars Klander, and Lingyan Tang (published by JAMSA Press - ISBN 1*88413357-6).
It gives a chat example that share images real-time. The code is too big for posting here, though. Send me your email address, and I'll send it on over....
Just a little addition...
It may be better to use an StdPicture object or an IPictureDisp object instead of a PictureBox.