Hi...
I am working on webcam and I have a windows form application that contains a picture box and that picture box gets image from webcam on a button event...
now i want to save it in database by converting into byte..
Please help me.....
How to convert webcam captured picture to byte
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Zoran HorvatRank #792 · 2.9K reputationPosted Jul 27, 2011, 12:33 AM EDT
Image img = new Bitmap(10, 10);
byte[] binaryImage = null;
using (System.IO.MemoryStream memStream = new System.IO.MemoryStream())
{
img.Save(memStream, ImageFormat.Jpeg);
memStream.Flush();
binaryImage = new byte[memStream.Position];
memStream.Position = 0;
memStream.Read(binaryImage, 0, binaryImage.Length);
}
I've just written it from scratch without testing, but I'm sure that you'll test it :)
Zoran
Kanhialal kkRank #8,477 · 221 reputationPosted Jul 27, 2011, 12:46 AM EDT
Zoran HorvatRank #792 · 2.9K reputationPosted Jul 27, 2011, 12:48 AM EDT
That's all... The rest of the code has nothing to do with the method in which image was obtained.
Zoran
pisey sen15 reputationPosted Jan 7, 2013, 5:10 PM EST