private void StopCapture() { if (_cap != null) { _cap.Stop(); _cap = null; } _stopBtn.Enabled = false; _startBtn.Enabled = true; stopToolStripMenuItem.Enabled = false; startToolStripMenuItem.Enabled = true; EnableSettings(true); }
private void StartBtnClick(object sender, EventArgs e) { if (_cap == null) { if (!IsCaptureAreaValid) { Report.Error("The capture area is not valid."); return; } ScreenCapturerParameters param = CreateCaptureParams(); if (param != null) { _cap = new ScreenCapturer(param) { Interval = TimeSpan.FromSeconds(Convert.ToDouble(_intervalNum.Value)) }; } else { Report.Error("You must select an image format."); return; } } try { _cap.Start(); } catch (Exception ex) { Report.Error(ex.Message); return; } _startBtn.Enabled = false; _stopBtn.Enabled = true; stopToolStripMenuItem.Enabled = true; startToolStripMenuItem.Enabled = false; EnableSettings(false); }