我得到:
Could not find schema information for the attribute 'useLegacyV2RuntimeActivationPolicy'.
Could not find schema information for the element 'supportedRuntime'.
Could not find schema information for the attribute 'version'.
Could not find schema information for the attribute 'sku'.
当我尝试编译时
private void button1_Click(object sender, EventArgs e)
{
Bitmap sourceImage = new Bitmap(System.Drawing.Image.FromFile("numbers.bmp", true));
Bitmap nbmp = new Bitmap(sourceImage.Width * 4, sourceImage.Height * 4);
Graphics g = Graphics.FromImage(nbmp);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bicubic;
g.DrawImage(sourceImage, 0, 0, nbmp.Width, nbmp.Height);
g.Dispose();
tessnet2.Tesseract t = new tessnet2.Tesseract();
t.SetVariable("tessedit_char_whitelist", "0123456789");
t.Init("tessdata", "eng", true);
tessnet2.Word result = t.DoOCR(nbmp, new Rectangle(0, 0, nbmp.Width, nbmp.Height))[0];
richTextBox1.AppendText(result.ToString());
}
我从http://www.pixel-technology.com/freeware/tessnet2/加载了 tessnet2_32.dll(Tesseract .NET 包装器(v 2.04.0))
我的 app.conf
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
有谁知道这可能是什么原因?