private void CaptureLightRectangle(TaskSettings taskSettings = null, bool autoHideForm = true) { if (taskSettings == null) { taskSettings = TaskSettings.GetDefaultTaskSettings(); } DoCapture(() => { Image img = null; using (RectangleLight rectangleLight = new RectangleLight()) { if (rectangleLight.ShowDialog() == DialogResult.OK) { img = rectangleLight.GetAreaImage(); if (img != null) { isLightCapture = true; } } } return(img); }, CaptureType.Rectangle, taskSettings, autoHideForm); }
private void btnCaptureArea_Click(object sender, RoutedEventArgs e) { WindowState = WindowState.Minimized; Thread.Sleep(300); RectangleLight crop = new RectangleLight(); if (crop.ShowDialog() == true) { editor.LoadImage(crop.GetScreenshot()); } WindowState = WindowState.Normal; }