protected ImageInfo ExecuteRegionCapture(TaskSettings taskSettings) { ImageInfo imageInfo = new ImageInfo(); CursorData cursorData = null; if (taskSettings.CaptureSettings.ShowCursor) { cursorData = new CursorData(); } using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Annotation, taskSettings.CaptureSettingsReference.SurfaceOptions /*, img*/)) { if (cursorData != null && cursorData.IsVisible) { form.AddCursor(cursorData.Handle, CaptureHelpers.ScreenToClient(cursorData.Position)); } form.Closable = false; ScreenRecordManager.recordForm.StopRequested += () => { form.Closable = true; form.Close(); }; form.ShowDialog(); } return(imageInfo); }