/// <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(); }
/// <summary> /// Close and dispose all camera and DirectX stuff. /// </summary> public void CloseCamera() { if (_Camera != null) { _Camera.StopGraph(); _Camera.CloseAll(); _Camera.Dispose(); _Camera = null; } }
/// <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(); }