コード例 #1
0
ファイル: MainForm.cs プロジェクト: hpbaotho/vsl
		/// <summary>
		/// Opens the video source and prepares the surveillance system.
		/// </summary>
		/// <param name="source">The video source.</param>
		/// <param name="surveillance">The surveillance system.</param>
		/// <param name="conf">The configuration for the image process.</param>
		/// <param name="output">The output.</param>
		private void OpenVideoSource(IVideoSource source, ISurveillanceSystem surveillance, IDictionary<string, object> conf, IOutput output)
		{
			// set busy cursor
			Cursor = Cursors.WaitCursor;
			// create camera
			camera = new Camera(source, surveillance.GetImageProcess(conf), output, surveillance.GraphicalOutput, pictureBox1);
			Cursor = Cursors.Default;
		}
コード例 #2
0
ファイル: MainForm.cs プロジェクト: hpbaotho/vsl
		/// <summary>
		/// Cleans this instance by closing unused resources like camera.
		/// </summary>
		private void Clean()
		{
			if (camera != null)
			{
				// detach camera from camera window
				//cameraWindow.Camera = null;

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

				camera = null;
			}

			if (outputSystem != null)
			{
				outputSystem.Close();
			}

			if (surveillanceSystem != null)
			{
				surveillanceSystem.Close();
			}
		}