public static void OpenOCR(TaskSettings taskSettings = null) { if (taskSettings == null) { taskSettings = TaskSettings.GetDefaultTaskSettings(); } using (Image img = RegionCaptureHelpers.GetRegionImage(taskSettings.CaptureSettings.SurfaceOptions)) { if (img != null) { using (Stream stream = SaveImage(img, EImageFormat.PNG)) { if (stream != null) { using (OCRSpaceForm form = new OCRSpaceForm(stream, "ShareX.png")) { form.Language = Program.Settings.OCRLanguage; form.ShowDialog(); Program.Settings.OCRLanguage = form.Language; } } } } } }
public static void OpenOCR() { using (Image img = RegionCaptureHelpers.GetRegionImage()) { if (img != null) { using (Stream stream = SaveImage(img, EImageFormat.PNG)) { if (stream != null) { using (OCRSpaceForm form = new OCRSpaceForm(stream, "ShareX.png")) { form.Language = Program.Settings.OCRLanguage; form.ShowDialog(); Program.Settings.OCRLanguage = form.Language; } } } } } }