// Open video source private void OpenVideoSource(IVideoSource source) { // set busy cursor this.Cursor = Cursors.WaitCursor; // close previous file CloseFile(); // create camera Camera camera = new Camera(source, detector); // start camera camera.Start(); // attach camera to camera window cameraWindow.Camera = camera; // reset statistics statIndex = statReady = 0; // start timer timer.Start(); this.Cursor = Cursors.Default; }
// Open video source private void OpenVideoSource(IVideoSource source) { // set busy cursor this.Cursor = Cursors.WaitCursor; // close previous file CloseFile( ); // enable/disable motion alarm if (detector != null) { detector.MotionLevelCalculation = motionAlarmItem.Checked; } // create camera Camera camera = new Camera(source, detector); // start camera camera.Start( ); // attach camera to camera window cameraWindow.Camera = camera; // reset statistics statIndex = statReady = 0; // set event handlers camera.NewFrame += new EventHandler(Camera_NewFrame); camera.Alarm += new EventHandler(Camera_Alarm); // start timer timer.Start( ); this.Cursor = Cursors.Default; }
// Open video source private void OpenVideoSource( IVideoSource source ) { // set busy cursor this.Cursor = Cursors.WaitCursor; // close previous file CloseFile( ); // enable/disable motion alarm if ( detector != null ) { detector.MotionLevelCalculation = motionAlarmItem.Checked; } // create camera Camera camera = new Camera( source, detector ); // start camera camera.Start( ); // attach camera to camera window cameraWindow.Camera = camera; // reset statistics statIndex = statReady = 0; // set event handlers camera.NewFrame += new EventHandler( camera_NewFrame ); camera.Alarm += new EventHandler( camera_Alarm ); // start timer timer.Start( ); this.Cursor = Cursors.Default; }
// Open video source public void OpenVideoSource(IVideoSource source) { // set busy cursor Cursor = Cursors.WaitCursor; // close previous file CloseFile(); // create camera var camera = new Camera(source, detector); // start camera camera.Start(); // attach camera to camera window cameraWindow.Camera = camera; if (!Lines) { Graphics dc = cameraWindow.CreateGraphics(); var redPen = new Pen(Color.Red, 1); dc.DrawLine(redPen, pictureBox1.Size.Width / 2, 0, pictureBox1.Size.Width / 2, pictureBox1.Size.Height); dc.DrawLine(redPen, 0, pictureBox1.Size.Height / 2, pictureBox1.Size.Width, pictureBox1.Size.Height / 2); } // reset statistics // statIndex = statReady = 0; // start timer timer.Start(); this.Cursor = Cursors.Default; }