BinaryWriter bw = new BinaryWriter(clientStream); MemoryStream ms = new MemoryStream(); Jpgs.image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); //Image gets distorted here! Jpgs.image is just an image property that returns an image from the buffer array on get{} byte[] imageData = ms.ToArray(); //byte array that contains distorted image ms.Flush(); ms.Dispose(); bw.Write(encoder.GetBytes("--BoundaryString\r\n" + "Content-type: image/jpg\r\n" + "Content-Length: " + imageData.Length.ToString() + "\r\n\r\n")); bw.Write(imageData); bw.Write("\r\n\r\n"); bw.Flush();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)