mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Save OCR language selection
This commit is contained in:
parent
4c3f0efd1f
commit
c477c8a011
4 changed files with 18 additions and 7 deletions
|
@ -80,13 +80,13 @@ private void InitializeComponent()
|
|||
// llAttribution
|
||||
//
|
||||
this.llAttribution.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.llAttribution.AutoSize = true;
|
||||
this.llAttribution.Location = new System.Drawing.Point(440, 8);
|
||||
this.llAttribution.Location = new System.Drawing.Point(320, 8);
|
||||
this.llAttribution.Name = "llAttribution";
|
||||
this.llAttribution.Size = new System.Drawing.Size(114, 13);
|
||||
this.llAttribution.Size = new System.Drawing.Size(232, 24);
|
||||
this.llAttribution.TabIndex = 4;
|
||||
this.llAttribution.TabStop = true;
|
||||
this.llAttribution.Text = "Using OCR.Space API";
|
||||
this.llAttribution.Text = "Powered by OCR.Space API";
|
||||
this.llAttribution.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
this.llAttribution.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAttribution_LinkClicked);
|
||||
//
|
||||
// btnStartOCR
|
||||
|
|
|
@ -26,6 +26,7 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using ShareX.ScreenCaptureLib;
|
||||
using ShareX.UploadersLib;
|
||||
using ShareX.UploadersLib.OtherServices;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
@ -257,5 +258,11 @@ public ApplicationConfig()
|
|||
public WebpageCaptureOptions WebpageCaptureOptions = new WebpageCaptureOptions();
|
||||
|
||||
#endregion Webpage Capture Form
|
||||
|
||||
#region OCR Form
|
||||
|
||||
public OCRSpaceLanguages OCRLanguage = OCRSpaceLanguages.eng;
|
||||
|
||||
#endregion OCR Form
|
||||
}
|
||||
}
|
|
@ -675,13 +675,15 @@ public static void OpenOCR()
|
|||
{
|
||||
if (img != null)
|
||||
{
|
||||
using (Stream stream = SaveImage(img, EImageFormat.JPEG, 90))
|
||||
using (Stream stream = SaveImage(img, EImageFormat.JPEG, 95))
|
||||
{
|
||||
if (stream != null)
|
||||
{
|
||||
using (OCRSpaceForm form = new OCRSpaceForm(stream, "ShareX.jpg"))
|
||||
{
|
||||
form.Language = Program.Settings.OCRLanguage;
|
||||
form.ShowDialog();
|
||||
Program.Settings.OCRLanguage = form.Language;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -968,9 +968,11 @@ private void DoOCR()
|
|||
{
|
||||
if (Data != null && Info.DataType == EDataType.Image)
|
||||
{
|
||||
using (OCRSpaceForm ocrForm = new OCRSpaceForm(Data, Info.FileName))
|
||||
using (OCRSpaceForm form = new OCRSpaceForm(Data, Info.FileName))
|
||||
{
|
||||
ocrForm.ShowDialog();
|
||||
form.Language = Program.Settings.OCRLanguage;
|
||||
form.ShowDialog();
|
||||
Program.Settings.OCRLanguage = form.Language;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue