Beispiel #1
0
 private void ReleaseResource()
 {
     if (mCamera != null)
     {
         if (mCamera.IsGrab)
         {
             mCamera.StopGrabbing();
         }
         if (mCamera.IsOpen)
         {
             mCamera.Close();
         }
         mCamera = null;
     }
     if (mLight != null)
     {
         if (mLight.Serial.IsOpen)
         {
             mLight.Close();
             mLight = null;
         }
     }
 }
Beispiel #2
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (mCamera != null)
     {
         if (mCamera.IsGrab)
         {
             mCamera.StopGrabbing();
         }
         if (mCamera.IsOpen)
         {
             mCamera.Close();
         }
         mCamera = null;
     }
     if (mLight != null)
     {
         if (mLight.Serial.IsOpen)
         {
             mLight.Close();
             mLight = null;
         }
     }
 }