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.....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Zoran HorvatPosted Jul 27, 2011, 4:33 AM
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
pisey senPosted Jan 7, 2013, 10:10 PM
Zoran HorvatPosted Jul 27, 2011, 4:48 AM
That's all... The rest of the code has nothing to do with the method in which image was obtained.
Zoran
Kanhialal kkPosted Jul 27, 2011, 4:46 AM