Пример #1
0
 public void CloseCamera()
 {
     if (this._Camera != null)
     {
         this._Camera.StopGraph();
         this._Camera.CloseAll();
         this._Camera.Dispose();
         this._Camera = null;
     }
 }
Пример #2
0
 public void SetCamera(IMoniker moniker, Camera_NET.Resolution resolution)
 {
     this.CloseCamera();
     if (moniker != null)
     {
         this._Camera = new Camera_NET.Camera();
         if (!string.IsNullOrEmpty(this._DirectShowLogFilepath))
         {
             this._Camera.DirectShowLogFilepath = this._DirectShowLogFilepath;
         }
         if (resolution != null)
         {
             this._Camera.Resolution = resolution;
         }
         this._Camera.Initialize(this, moniker);
         this._Camera.BuildGraph();
         this._Camera.RunGraph();
         this._Camera.OutputVideoSizeChanged += new EventHandler(this.Camera_OutputVideoSizeChanged);
     }
 }