110,534
社区成员
发帖
与我相关
我的任务
分享
string result="";
Size sz = new Size(188, 160);
Bitmap image = new Bitmap(sz.Width, sz.Height);
Graphics imgGraphics = Graphics.FromImage(image);
imgGraphics.CopyFromScreen(X - sz.Width / 2, Y - sz.Height / 2, 0, 0, new Size(Width, Height));
image.Save("dest.jpg", ImageFormat.Jpeg);//保存到硬盘
MODI.Document doc = new MODI.Document();//MODI引用自Microsoft Office Document Imaging的组件
doc.Create("dest.jpg");//貌似这里是关键
MODI.Image image1;
MODI.Layout layout;
doc.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true);
for (int i = 0; i < doc.Images.Count; i++)
{
image1 = (MODI.Image)doc.Images[i];
layout = image1.Layout;
result += layout.Text;
}