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

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

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

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

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

Loading…
Cancel
Save