Exemplo n.º 1
0
 public WmCapture(Size i_cap_size,bool i_vertical_flip_property)
 {
     //キャプチャ作る。
     NyWMCapture cap = new NyWMCapture();
     INyWMCapture cap_if = (INyWMCapture)cap;
     int hr;
     hr = cap_if.SetCallBack(this);//これInitializeの前にやらないといけないのよね。
     if (hr != 0)
     {
         throw new Exception("cap_if.SetCallBack");
     }
     hr = cap_if.SetSize(i_cap_size.Width, i_cap_size.Height);
     if (hr != 0)
     {
         throw new Exception("cap_if.SetSize");
     }
     hr = cap_if.Initialize(NyWMCapture.DeviceId_WM5, NyWMCapture.MediaSubType_RGB565, NyWMCapture.PinCategory_PREVIEW);
     if (hr != 0)
     {
         throw new Exception("cap_if.Initialize");
     }
     this._capture = cap_if;
     this._vertical_flip = i_vertical_flip_property;
     return;
 }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (this._capture != null)
     {
         if (this._is_start)
         {
             this._capture.Stop();
         }
         this._capture.Finalize();
         this._capture = null;
     }
     return;
 }