using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Barcode;
using Leadtools.ImageProcessing;
public void BarcodeData_GetDataExample()
{
string imageFileName = Path.Combine(LEAD_VARS.ImagesDir, "Barcode2.tif");
// Create a Barcode engine
BarcodeEngine engine = new BarcodeEngine();
// Load the image
using (RasterCodecs codecs = new RasterCodecs())
{
using (RasterImage image = codecs.Load(imageFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1))
{
// Read the first QR barcode from the image
BarcodeData data = engine.Reader.ReadBarcode(image, LogicalRectangle.Empty, BarcodeSymbology.QR);
// Show the barcode data found (if any)
if (data != null)
{
Console.WriteLine("Raw data is:");
byte[] bytes = data.GetData();
if (bytes != null)
{
string text = System.Text.Encoding.UTF8.GetString(bc);
Console.WriteLine(text);
}
else
{
Console.WriteLine("Empty");
}
}
else
{
Console.WriteLine("No barcode found");
}
}
}
}

微软在2017年9月发布的免费开源代码编辑器Visual Studio Code(v1.17)进行了一些重要的更新。支持将区域标记带入代码折叠,并提升内置终端的性能。
通过代码折叠,开发人员可以使用行号之间的折叠图标和一行代码的开始来隐藏源代码区域。区域标记允许您使用注释来精确指定可折叠块的开始和结束位置。目前已经为TypeScript、JavaScript、C和C ++、C#、F#、PowerShell和Visual Basic定义了标记。
1.17版本也是一款基于画布的渲染引擎,具有集成终端功能,可根据情况将渲染从5提升到45倍。微软表示:“这种改变减少了输入延迟、功耗,并显着提高了终端的帧速率。”集成终端可以节省开发人员的时间,不必切换窗口或更改现有终端状态,以便快速执行命令行任务。
Visual Studio Code现在有一个源代码管理提供程序,提供了多个可以由SCM提供程序提供的存储库的概述。例如,Git存储库可以与Microsoft Team Foundation Server工作区并排维护。用户可以利用Ctrl+单击或Shift单击功能来选择多个存储库,这些存储库显示为拆分视图。
对于Mac用户来说,Visual Studio Code1.17增加了在MacOS Touch Bar中显示操作的支持。可以在编辑器历史记录中导航并控制调试器。此外,扩展项可以用于通过touchBar菜单标识符向Touch Bar添加命令。同时也为MacOS Sierra添加了本地窗口选项卡的支持。
最后,Visual Studio Code现在为Java开发人员提供了新的在线文档。Java调试最近通过扩展添加到了Visual Code中。
有关Visual Studio的更多信息,请参阅慧都控件网Visual Studio。

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();
}










