Exemplo n.º 1
0
        /// <summary>
        /// Initializes camera, builds and runs graph for control.
        /// </summary>
        /// <param name="moniker">Moniker (device identification) of camera.</param>
        /// <param name="resolution">Resolution of camera's output.</param>
        public void SetCamera(IMoniker moniker, Resolution resolution)
        {
            // Close current if it was opened
            CloseCamera();

            if (moniker == null)
            {
                return;
            }

            // Create camera object
            _Camera = new NetCamera();

            if (resolution != null)
            {
                _Camera.Resolution = resolution;
            }

            // Initialize
            _Camera.Initialize(moniker);

            // Build and Run graph
            _Camera.BuildGraph();
            _Camera.RunGraph();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Close and dispose all camera and DirectX stuff.
 /// </summary>
 public void CloseCamera()
 {
     if (_Camera != null)
     {
         _Camera.StopGraph();
         _Camera.CloseAll();
         _Camera.Dispose();
         _Camera = null;
     }
 }
Exemplo n.º 3
0
		/// <summary>
		/// Close and dispose all camera and DirectX stuff.
		/// </summary>
		public void CloseCamera()
		{
			if (_Camera != null)
			{
				_Camera.StopGraph();
				_Camera.CloseAll();
				_Camera.Dispose();
				_Camera = null;
			}
		}
Exemplo n.º 4
0
		/// <summary>
		/// Initializes camera, builds and runs graph for control.
		/// </summary>
		/// <param name="moniker">Moniker (device identification) of camera.</param>
		/// <param name="resolution">Resolution of camera's output.</param>
		public void SetCamera(IMoniker moniker, Resolution resolution)
		{
			// Close current if it was opened
			CloseCamera();

			if (moniker == null)
				return;

			// Create camera object
			_Camera = new NetCamera();

			if (resolution != null)
			{
				_Camera.Resolution = resolution;
			}

			// Initialize
			_Camera.Initialize(moniker);

			// Build and Run graph
			_Camera.BuildGraph();
			_Camera.RunGraph();
		}