المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Assembling bytes to an image



C# Programming
03-07-2010, 02:40 PM
Hi all. I have a client-server distributed system. I want to transfer and image from the server to the client. In the server i have converted a .bmp image to byte array as this:

Image imageIn = Image.FromFile("me.bmp") ;
MemoryStream msr = new MemoryStream();
imageIn.Save(msr, System.Drawing.Imaging.ImageFormat.Gif);
byte[] byteIm = msr.ToArray();

ms.Send(byteIm);
The bytes are being transfered okay to the client. The problem is that i don't know how to assemble this byte back to an image to show in a picture box.
That is:

pictureBox1.Image = http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.