Signed-off-by: lilium-saber <WR364999428@hotmail.com>
GDN
lilium-saber 1 year ago
parent 92907c90c4
commit 5f0d8ff810

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApp1.WinOcr;
using WpfApp1.ScnToJson;
using WpfApp1.translationKey;
namespace testRjgc
{
internal class AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction
{
AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction() { }
public void InputPrivate(string name, string id, string key)
{
TranslationPrivateIn tr = new TranslationPrivateIn();
tr.InputTranslationPrivate(name, id, key);
}
public List<string> OutputNameList(string id)
{
TranslationApiStr tr = new translationPrivateOut();
List<string> list = tr.OutputTranslationNameList();
return list;
}
public List<string> OutputStr(string id)
{
TranslationApiStr str = new translationPrivateOut();
List<string> li = str.OutputTranslationS(id);
return li;
}
public List<string> OutputPub(int id)
{
TranslationApiInt sin = new translationPublic();
List<string> li = sin.OutputTranslationI(id);
return li;
}
public void StartSCNTransJSON()
{
TranslationScnToJson scn = new TranslationScnToJson();
scn.StartTrans();
}
public void StartTransOneself(string spa, string dps)
{
TranslationScnToJson scn = new TranslationScnToJson();
scn.StopTrans(spa, dps);
}
public string WindowsOcrToGetString(string name)
{
Sofia so = new OcrSofia();
string temp = so.WindowsOcrToGetStringAndTranslate(name);
return temp;
}
}
}

@ -4,9 +4,9 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
//using System.Windows.Forms;
namespace testRjgc.WinOcr
namespace WpfApp1.WinOcr
{
internal class OcrSofia : Sofia
{
@ -20,12 +20,13 @@ namespace testRjgc.WinOcr
this.DirExists();
Image image = null;
/*
MODI.Document modiDocument = new MODI.Document();
modiDocument.Create(path + "\\" + name + ".jpg");
modiDocument.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true);
MODI.Image modiImage = (MODI.Image)modiDocument.Images[0];
retxt = modiImage.Layout.Text;
*/
return retxt;
}

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace testRjgc.WinOcr
namespace WpfApp1.WinOcr
{
internal interface Sofia
{

@ -15,7 +15,7 @@ namespace WpfApp1.translationKey
public TranslationPrivateIn() { }
public void InputTranslationPrivate(string name, string id, string key)
public void InputTranslationPrivate(string name, string id, string key)//目前仅百度支持
{
if(Directory.Exists(pathTemp))
{

@ -60,7 +60,7 @@ namespace WpfApp1.translationKey
if (Directory.Exists(temppath))//诺不存在
{
temp.Add("ERROR");
temp.Add("尚未输入!!!");
return temp;
}

@ -27,10 +27,16 @@ namespace WpfApp1.translationKey
temp.Add("yjvMNY33Qc1TYSBjTQYQ");//APIKey
break;
}
case 2://google
case 2://百度2
{
temp.Add("");//NULL,空
temp.Add("");//APIKey
temp.Add("20230925001829663");
temp.Add("f7ZHpw28izQ1VU_ixoY5");
break;
}
case 3://google
{
temp.Add("UNSET!");//NULL,空
temp.Add("UNSET!");//APIKey
break;
}
}

Loading…
Cancel
Save