Welcome to my blog which contains anything and everything I feel is worthwhile sharing......

Friday, October 29, 2010

Convert PictureBox into a byte stream

Byte[] b = new Byte[0];
b = cov(pictureBox1);

public Byte[] cov(PictureBox p)
{

System.IO.MemoryStream ms = new System.IO.MemoryStream();
p.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
return ms.ToArray();
}