public void SendPicture() { WebEye.WebCameraControl webCameraControl1 = new WebCameraControl(); foreach (WebCameraId camera in webCameraControl1.GetVideoCaptureDevices()) { webCameraControl1.StartCapture(camera); Thread.Sleep(200); Bitmap test = GrayScale(new Bitmap(webCameraControl1.GetCurrentImage())); Program.A.SetMyWebCam(ScreenCapture.imageToByteArray(test)); } if (webCameraControl1.IsCapturing) { webCameraControl1.StopCapture(); } webCameraControl1.Dispose(); }
public void Dispose() { webCameraControl1.Dispose(); }