static void SimpleOCRCalculator(string filePath) { RasterCodecs codecs = new RasterCodecs(); RasterImage image = codecs.Load(filePath); string[] calculations; using (IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false)) { engine.Startup(null, null, null, null); IOcrPage page = engine.CreatePage(image, OcrImageSharingMode.None); page.AutoZone(null); page.Recognize(null); calculations = new string[page.Zones.Count]; for (int i = 0; i < page.Zones.Count; i++) { calculations[i] = page.GetText(i); } engine.Shutdown(); } Dictionary<string, Action<double, double>> operands = new Dictionary<string, Action<double, double>>(); operands.Add("+", new Action<double, double>(delegate(double a, double b) { double ans = a + b; Console.WriteLine("{0} + {1} = {2}", a, b, ans); })); operands.Add("-", new Action<double, double>(delegate(double a, double b) { double ans = a - b; Console.WriteLine("{0} - {1} = {2}", a, b, ans); })); operands.Add("x", new Action<double, double>(delegate(double a, double b) { double ans = a * b; Console.WriteLine("{0} * {1} = {2}", a, b, ans); })); operands.Add("/", new Action<double, double>(delegate(double a, double b) { double ans = a / b; Console.WriteLine("{0} / {1} = {2}", a, b, ans); })); for (int i = 0; i < calculations.Length; i++) { string equation = Regex.Replace(calculations[i], @"\n|\r| ", ""); string[] ops = new string[] { "+", "-", "x", "/" }; for (int j = 0; j < ops.Length; j++) { int index = equation.IndexOf(ops[j]); if (index > 0 && index < equation.Length) { string op1 = equation.Substring(0, index); string op2 = equation.Substring(index + 1); double arg1 = double.Parse(op1); double arg2 = double.Parse(op2); operands[ops[j]](arg1, arg2); break; } } } codecs.Dispose(); image.Dispose(); }
【慧都十四周年庆预热开启!全场满额送七级豪礼,AppleMac笔记本电脑、iwatch、iPad等您来拿!】
活动时间:10月1日-10月31日
AnyGantt是完全跨浏览器和跨平台的,可用于ASP.NET、ASP、PHP、JSP、ColdFusion、Ruby on Rails或简单的HTML页面。有了AnyGantt你可以从任何地方可视化数据:从文本、Excel、CSV格式中的文件到MySQL、MS SQL以及Oracle数据库服务器。(重要推荐:AnyGantt已加入在线订购,超值特价低至¥368起!)
【慧都十四周年庆预热开启!全场满额送七级豪礼,AppleMac笔记本电脑、iwatch、iPad等您来拿!】
活动时间:10月1日-10月31日
我们针对 Visual Studio 2017 的多个关键领域进行了重点研发——包括改进基础部件、提供五星级的云和移动开发体验,以及提升 DevOps 功能,以确保 Visual Studio 2017 可以助力每一位开发者在各种平台上开发各类应用。
在发展 Visual Studio 2017 这一全新版本时,我们将云和移动开发置于最重要的位置。为了简化云开发流程,内置的各项工具将为您提供有关.NET Core、Azure 应用、微服务、容器等应用开发的完整集成功能,甚至现在可以更轻松地由 IDE 直接开发和部署 Azure 应用和服务。Visual Studio 2017 with Xamarin 让你能够通过先进的调试和分析工具更加快速地为安卓、iOS 和 Windows 平台开发移动应用。
我们也重视聆听用户心声,并清楚地了解到用户希望 Visual Studio 变得更为快速、更精简,即使所面对的应用开发和项目愈加庞大。因此,我们将为用户提供全新的安装体验,让一切变得轻便而模块化。为提高 Visual Studio 的性能,我们还增强了多项功能。Visual Studio 2017 还将交付多项全新特性,帮助开发团队能够轻松地实践现代化的 DevOps 做法,更为快速而持续地应对市场变化。为了帮助开发者更好地把自己的数据库嵌入 DevOps,加速发布周期,Redgate Data Tools 工具现已加入 Visual Studio Enterprise 2017 服务当中。
试用、下载、了解更多产品信息请点击"咨询在线客服"
试用、下载、了解更多产品信息请点击"咨询在线客服"