private void captureButton_Click(object sender, EventArgs e) { #region if capture is not created, create it now if (_capture == null) { try { _capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion if (_capture != null) { if (_captureInProgress) { //stop the capture captureButton.Text = "Start Capture"; Application.Idle -= ProcessFrame; } else { //start the capture captureButton.Text = "Stop"; Application.Idle += ProcessFrame; } _captureInProgress = !_captureInProgress; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)