Pergunta

I am using this code to get images from my webcam, I guess its Metricam library

Anyone knows how to get images without using picturebox?

WebCam camera = new WebCam();
camera.Connect();
pictureBox1.Image = camera.GetBitmap();
pictureBox1.Image.Save(@"c:\image1 " + ".Jpeg", ImageFormat.Jpeg);
Foi útil?

Solução

pictureBox1.Image is Image type. It can handle saving on its own. It does handle saving when used from PictureBox too, notice how you call Save() method on Image property and not on pictureBox instance.

WebCam camera = new WebCam();
camera.Connect();
Image image = camera.GetBitmap();
image.Save(@"c:\image1 " + ".Jpeg", ImageFormat.Jpeg);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top