SignalToStop() 공개 메소드

public SignalToStop ( ) : void
리턴 void
예제 #1
0
        // Close current file
        private void CloseVideoSource()
        {
            Camera camera = cameraWindow.Camera;

            if (camera != null)
            {
                // detach camera from camera window
                cameraWindow.Camera = null;

                // signal camera to stop
                camera.SignalToStop();
                // wait for the camera
                camera.WaitForStop();

                //timer.Stop();
                camera = null;
            }
        }
예제 #2
0
        // Close current file
        private void CloseVideoSource()
        {
            Camera camera = cameraWindow.Camera;

            if (camera != null)
            {
                // detach camera from camera window
                cameraWindow.Camera = null;
                Application.DoEvents();

                // signal camera to stop
                camera.SignalToStop();
                // wait for the camera
                // camera.WaitForStop();
                // wait 5 seconds until camera stops
                for (int i = 0; (i < 50) && (camera.IsRunning); i++)
                {
                    Thread.Sleep(100);
                }
                if (camera.IsRunning)
                {
                    try
                    {
                        camera.Stop();
                    }
                    catch (Exception)
                    {
                    }
                }

                camera = null;

                if (mMotionDetector != null)
                {
                    mMotionDetector.Reset();
                }
            }

            this.StopCapture();
        }