private void FinilizeWia() { if (_wiaSession != null) { _wiaSession.Shutdown(); } }
private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // prevent the application from closing while acquiring. if (_wiaAcquiring) { e.Cancel = true; return; } _wiaSession.AcquireEvent -= new EventHandler <WiaAcquireEventArgs>(_wiaSession_AcquireEvent); if (_wiaAvailable) { _wiaSession.Shutdown(); } }