Hi,
what is the best way to transfer an 800*600 image via a webservice using C#?
I am looking for a fast method.
thanks
Hi,
what is the best way to transfer an 800*600 image via a webservice using C#?
I am looking for a fast method.
thanks
If you want to save bandwidth/Speed (Not tested on many different image formats)
7zip C# SDK (http://www.7-zip.org/sdk.html) 7-Zip the bytes and send the bytes
and where needed un"7-Zip" (LZMA) the bytes and convert to image.
If you are using WCF 4.0 then you could use socket programming and from there you could transmit as binary (compressed with 7zip of course).
If the image is already in a compressed format (jpeg for example) then compression would not be that great and it would slow down the actual total transfer (compress - transmit - decompress).
You'll probably want to send the image in small pieces (even if it's zipped up as Chris Schroeder mentioned), say 50K at a time. This gives you two advantages over sending the entire file at once:
However, with this method is you now have 2 new problems to handle and that is making sure you get ALL of the pieces, and that they're in the correct order.
Sending some metadata with the image data can fix this situation. An identifier that relates this piece of data with the others, and the piece number which will determine where this piece should be in relation to the rest of the pieces.
If you're using WSE, consider using MTOM.
If you're using WCF, you could use an MTOM binding.