public static bool ShowAfterCaptureForm(TaskSettings taskSettings, Image img = null) { if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { afterCaptureForm.ShowDialog(); switch (afterCaptureForm.Result) { case AfterCaptureFormResult.Continue: taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks; break; case AfterCaptureFormResult.Copy: taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard; break; case AfterCaptureFormResult.Cancel: if (img != null) { img.Dispose(); } return(false); } } } return(true); }
private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskSettings) { if (img != null) { if (taskSettings.GeneralSettings.PlaySoundAfterCapture) { Helpers.PlaySoundAsync(Resources.CameraSound); } if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType)) { taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects); } if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { afterCaptureForm.ShowDialog(); switch (afterCaptureForm.Result) { case AfterCaptureFormResult.Continue: taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks; break; case AfterCaptureFormResult.Copy: taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard; break; case AfterCaptureFormResult.Cancel: if (img != null) { img.Dispose(); } return; } } } UploadManager.RunImageTask(img, taskSettings); } }
public static bool ShowAfterCaptureForm(TaskSettings taskSettings, out string fileName, Image img = null) { fileName = null; if (taskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.ShowAfterCaptureWindow)) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { if (afterCaptureForm.ShowDialog() == DialogResult.Cancel) { if (img != null) { img.Dispose(); } return(false); } fileName = afterCaptureForm.FileName; } } return(true); }
public static bool ShowAfterCaptureForm(TaskSettings taskSettings, Image img = null) { if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { afterCaptureForm.ShowDialog(); switch (afterCaptureForm.Result) { case AfterCaptureFormResult.Continue: taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks; break; case AfterCaptureFormResult.Copy: taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard; break; case AfterCaptureFormResult.Cancel: if (img != null) img.Dispose(); return false; } } } return true; }
private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskSettings) { if (img != null) { if (taskSettings.GeneralSettings.PlaySoundAfterCapture) { Helpers.PlaySoundAsync(Resources.CameraSound); } if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType)) { taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects); } if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { afterCaptureForm.ShowDialog(); switch (afterCaptureForm.Result) { case AfterCaptureFormResult.Continue: taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks; break; case AfterCaptureFormResult.Copy: taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard; break; case AfterCaptureFormResult.Cancel: if (img != null) img.Dispose(); return; } } } UploadManager.RunImageTask(img, taskSettings); } }
public static bool ShowAfterCaptureForm(TaskSettings taskSettings, out string fileName, Image img = null) { fileName = null; if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings)) { if (afterCaptureForm.ShowDialog() == DialogResult.Cancel) { if (img != null) img.Dispose(); return false; } fileName = afterCaptureForm.FileName; } } return true; }
private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskSettings) { if (img != null) { if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType)) { taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddBorder, AfterCaptureTasks.AddShadow); } if (Program.Settings.ShowAfterCaptureTasksForm) { using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings.AfterCaptureJob)) { afterCaptureForm.ShowDialog(); switch (afterCaptureForm.Result) { case AfterCaptureFormResult.Continue: taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks; break; case AfterCaptureFormResult.Copy: taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard; break; case AfterCaptureFormResult.Cancel: if (img != null) img.Dispose(); return; } } } UploadManager.RunImageTask(img, taskSettings); } }