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

今年5月在西雅图举行的 Build 2017 开发者大会上,微软公布了 Windows 10 下一个重要更新——Windows 10 Fall Creators Update。Windows 10 Fall Creators Update将在今年下半年为超过 5 亿台 Windows 10 设备带来创新体验:其中包括一套用以在不同类型 Windows设备上实现创新的设计体系;全新的开发工具将让开发者轻松自如地在Windows平台工作;Windows 应用商店将要迎来 iTunes、Spotify、SAP Digital Boardroom 等人气应用;贯穿 Windows、iOS 和 Android 设备的一致的用户体验;此外,还有全球首款 Windows Mixed Reality(Windows 混合现实)动作控制器——完全无需依赖任何定位标记即可工作。
全新的设计体系,让开发者在 Windows 设备上更好地发挥创意
微软流畅设计体系(Fluent Design System)将带来直观、和谐、响应迅速、兼容广泛的跨设备体验与互动操作。对于开发者来说,流畅设计能帮助他们设计出更具表现力和吸引力的应用程序,并且广泛支持各种类型的设备和多样化的输入方式。
让开发者在轻松自如地使用 Windows
微软致力于让所有开发者都可以轻松自如地使用 Windows 和 Visual Studio——不仅仅是 Windows 应用程序开发,也包括跨越各类平台和设备的应用体验——。微软宣布了多个针对 Windows 开发者的新开发工具。
Windows应用商店全面支持Windows、iOS和Android UWP应用,欢迎iTunes上线
今年下半年,Windows应用商店将加入更多人气应用:
为用户带来贯穿 Windows、iOS和Android的一致体验
Microsoft Graph构建起了一个智能网络,将人、会话、项目和微软云上的内容相互连接起来,并且能够构建起在Windows、iOS、Android 设备之间无缝衔接的一致体验。其提供的关键功能包括:
Windows Story Remix:用图片和视频讲故事的新方式
Windows Story Remix 是一项基于.Net 技术构建并通过 Windows 商店分发的通用Windows应用(UWP),可以利用人工智能和深度学习技术整理照片和视频并将其转变为叙事形态。它利用 Microsoft Graph 连接不同设备的用户。Story Remix 将记忆、照片、视频整合成一个故事,并加入音轨、主题和串场切换效果。通过在照片和视频中加入 3D 对象,用户还可以构建出混合现实的视角,以新的方式讲述故事,或是将照片和视频当作画布,利用 Windows 墨迹书写在上面涂鸦绘画。
全球首个Windows Mixed Reality运动控制器——无需依赖位置标签
微软还带来了全球首款完全无需依赖位置标签的 Windows Mixed Reality 运动控制器,利用 Windows Mixed Reality 头戴设备中内置的传感器,就能对视野内的动作进行定位准确、响应迅速的动作跟踪,并且完全不需要在周围墙壁上安装任何硬件设备。
微软正在将 Windows 塑造为帮助每一人开启创作之途的平台。在此诚挚邀请诸位开始这一旅程:
DWObject.ShowImageEditor();


DWObject.OpenSource(); DWObject.IfShowUI = false; DWObject.IfDisableSourceAfterAcquire = true; DWObject.PixelType = EnumDWT_PixelType.TWPT_BW; //Black - White image : EnumDWT_PixelType.TWPT_BW, GRAY image: EnumDWT_PixelType.TWPT_GRAY, RGB image: EnumDWT_PixelType.TWPT_RGB DWObject.AcquireImage();
function BeginScan(){
DWObject.OpenSource();
DWObject.IfShowUI = false; //set without user interface
DWObject.IfDisableSourceAfterAcquire = true;
DWObject.AcquireImage();
}
function DWObject_OnPostTransfer(){
DWObject.SaveAsBMP("C:\\temp.bmp",0);
}DWObject.SelectSource(); DWObject.OpenSource(); DWObject.IfShowUI = false; //Set Image Layout DWObject.Unit = EnumDWT_UnitType.TWUN_INCHES; DWObject.SetImageLayout(0, 0, 5, 5); DWObject.AcquireImage();
DWObject.OpenSourceManager();
for(i = 0, i<=DWObject.SourceCount - 1,i++){
if (DWObject.GetSourceNameItems(i) == "Specified device name")
DWObject.SelectSourceByIndex (i);
}
//if can't find the specified source, it'll select default source
DWObject.AcquireImage(); DWObject.IfShowUI = false; DWObject.IfDisableSourceAfterAcquire = true; DWObject.OpenSource(); DWObject.IfShowIndicator = false; DWObject.AcquireImage();
DWObject.SelectSource();
DWObject.OpenSource();
//Set XRESOLUTION current value.
DWObject.Capability = 0x1118; //ICAP_XRESOLUTION
DWObject.CapType = 5; //TWON_ONEVALUE
DWObject.CapValue = 300;
if (DWObject.CapSet == false){
alert( "Failed to set the x-resolution. " + DWObject.ErrorString);
}
//Set YRESOLUTION current value.
DWObject.Capability = 0x1119; //ICAP_YRESOLUTION
DWObject.CapType = 5; //TWON_ONEVALUE
DWObject.CapValue = 200;
if (DWObject.CapSet == false){
alert( "Failed to set the y-resolution." + DWObject.ErrorString);
}
DWObject.AcquireImage();DWObject = document.getElementById("dwtcontrolContainer");
//dwtcontrolContainer is the id of the Dynamic Web TWAIN on the page (An object or an embed).
function btnScan_onclick()
{
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.AcquireImage();
}
function btnUpload_onclick()
{
var strActionPage;
var strHostIP;
var CurrentPathName = unescape(location.pathname); // get current PathName in
plain ASCII
var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/")
+ 1);
strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path
strHostIP = "localhost"; //The host's IP or name
DWObject.HTTPPort = 80;
DWObject.HTTPUploadThroughPost(strHostIP,0,strActionPage,"imageData.tif");
if (DWObject.ErrorCode != 0)
alert(DWObject.ErrorString);
else //succeed
alert("Image Uploaded successfully");
}var iDocumentCounter =0;
function BeginScan(){
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.IfDisableSourceAfterAcquire = true;
if(DWObject.Duplex != TWDX_NONE)
DWObject.IfDuplexEnabled = true; //enable duplex
DWObject.IfFeederEnabled = true;
if (DWObject.IfFeederEnabled == true){
DWObject.XferCount = -1;
if(DWObject.IfFeederLoaded == True)
DWObject.AcquireImage();
}
}
function DWObject_OnPosttransfer(){
iDocumentCounter = iDocumentCounter + 1;
if(DWObject.SaveAsBMP("C:\\Image\\" + iDocumentCounter + ".bmp", 0) == false)
alert( DWObject.ErrorString);
}function btnUpload_onclick()
{
DWObject.HTTPPort = 80;
DWObject.IfSSL = false; // if 80 is the port number of
non-secure port
/*
DWObject.HTTPPort = 443;
DWObject.IfSSL = true; // if 443 is the port number of secure
port
*/
DWObject.HTTPUploadThroughPost("127.0.0.1", 0,
"/SaveToFile.php", "imageData.jpg");
if (DWObject.ErrorCode != 0)
alert(DWObject.ErrorString);
else //succeed
alert("Successful");
}function Scan_Click(){
DWObject.AcquireImage();
}
function DWObject_OnPostTransfer(){
DWObject.CloseSource();
DWObject.IfTiffMultiPage = true;
DWObject.SaveAsTIFF("SaveAsTIFF.tif", 0);
if (DWObject.ErrorCode != 0)
alert (DWObject.ErrorString);
else //succeed
alert ("Successful");
}function NextImage_Click(){
if (DWObject.HowManyImagesInBuffer == 0)
alert ("There is no image in buffer");
DWObject.CurrentImageIndexInBuffer += 1;
}
13.如何进行双面扫描?
function DuplexScan_Click(){
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.IfDuplexEnabled = true; //enable duplex
DWObject.AcquireImage();
} 