private void btnStart_Click(object sender, EventArgs e) { CaptureAreaType captureType = CaptureAreaType.catMouse; if (cmbCapturingType.SelectedIndex == 1) { captureType = CaptureAreaType.catScreen; } StartRecording(captureType); }
private void StartRecording(CaptureAreaType captureType) { btnStart.Enabled = false; btnPauseResume.Enabled = true; btnStop.Enabled = true; _capturingThreadData.CaptureType = captureType; // Start thread _capturingThread = new Thread(CapturingThread.ThreadProc); _capturingThread.Start(_capturingThreadData); // Signal to start the recording _capturingThreadData.StartOrResumeEvent.Set(); }
private void StartRecording(CaptureAreaType captureType, bool withCam) { _recording = true; if (withCam) { _dropDownItems = tsbRecordWithCam.DropDown; tsbRecord.Enabled = false; tsbRecordWithCam.ShowDropDownArrow = false; tsbRecordWithCam.DropDown = null; tsbRecordWithCam.Image = Resources.stop; tsbRecordWithCam.Text = "Stop"; } else { _dropDownItems = tsbRecord.DropDown; tsbRecordWithCam.Enabled = false; tsbRecord.ShowDropDownArrow = false; tsbRecord.DropDown = null; tsbRecord.Image = Resources.stop; tsbRecord.Text = "Stop"; } statusBar.Items[0].Text = "Recording started"; tsbPlay.Enabled = false; if (!Program.Cfg.DoNotShowMessage1) { CustomMessageBox mb = new CustomMessageBox(Application.ProductName, "Press CTRL-SHIFT-F12 to stop recording."); mb.StartPosition = FormStartPosition.CenterScreen; mb.ShowDialog(); Program.Cfg.DoNotShowMessage1 = mb.DoNotShow; } RegisterHotKey(Handle, MYKEYID, MOD_CONTROL + MOD_SHIFT, Keys.F12); _capturingThreadData = new CapturingThreadData(); _capturingThreadData.CaptureType = captureType; _capturingThreadData.CaptureRectangle = _recordingRegion; _capturingThreadData.ShowWebCamStream = withCam; _capturingThread = new Thread(CapturingThread.ThreadProc); _capturingThread.Start(_capturingThreadData); WindowState = FormWindowState.Minimized; }