Пример #1
0
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (_capture == null)
            {
                SetupCapture();
            }
            if (_capture != null)
            {
                if (CameraCaptureInProgress)
                {
                    //stop the capture
                    btnStartStop.Text = "Start Capture";
                    _capture.Dispose();
                    _capture = null;
                }
                else
                {
                    btnStartStop.Text = "Stop";
                    _capture.Start();
                    toolStripLabelSettings.Text = _capture.GetCaptureProperties().ToString();
                }

                CameraCaptureInProgress = !CameraCaptureInProgress;
            }
        }
Пример #2
0
        /// <summary>
        /// So we can replace with a new framerate
        /// </summary>
        public void UpdateCaptureGrabber(ICaptureGrab captureGrabber)
        {
            if (CameraCapture != null)
            {
                CameraCapture.ImageGrabbed -= InternalImageGrabbedHandler;
                CameraCapture.Stop();
            }

            CameraCapture = captureGrabber;
            CameraCapture.ImageGrabbed += InternalImageGrabbedHandler;

            if (Started)
            {
                CameraCapture.Start();
            }
        }
Пример #3
0
        /// <summary>
        /// So we can replace with a new framerate
        /// </summary>
        public void UpdateCaptureGrabber(ICaptureGrab captureGrabber)
        {
            if (CameraCapture != null)
            {
                CameraCapture.ImageGrabbed -= InternalImageGrabbedHandler;
                CameraCapture.Stop();
            }

            CameraCapture = captureGrabber;
            CameraCapture.ImageGrabbed += InternalImageGrabbedHandler;

            if (Started)
            {
                CameraCapture.Start();
            }
        }