private void btnCapture_Click(object sender, EventArgs e) { if (!(ddWindows.SelectedItem is ProcessWrapper)) { MessageBox.Show("Select window first.", "Screener", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } new PreviewForm(CaptureHelper.Capture(((ProcessWrapper)ddWindows.SelectedItem).Process.MainWindowHandle)).Show(); Close(); }
private void SnippingForm_AreaSelected(Rectangle rect) { while (_sfQueue.Count > 0) { SnippingForm form = _sfQueue.Dequeue(); form.AreaSelected -= SnippingForm_AreaSelected; form.Close(); } _areaSnippingMode = false; ShowPreview(CaptureHelper.Capture(rect)); }
//private void ChangeFormVisibility_MouseAction(object sender, MouseEventArgs e) //{ // if (e.Button != MouseButtons.Left) return; // if (!_useVisibleCore) _useVisibleCore = true; // if (!Visible) UpdateSettings(); // Visible = !Visible; //} private void cmsNotifyIcon_VisibleChanged(object sender, EventArgs e) { if (cmsNotifyIcon.Visible == true) { cmsiCaptureScreen.DropDownItems.Clear(); foreach (Screen screen in Screen.AllScreens) { cmsiCaptureScreen.DropDownItems.Add(screen.DeviceName, null, delegate { ShowPreview(CaptureHelper.Capture(screen)); }); } } }