010-68421378
sales@cogitosoft.com
Categories
AddFlow  AmCharts JavaScript Stock Chart AmCharts 4: Charts Aspose.Total for Java Altova SchemaAgent Altova DatabaseSpy Altova MobileTogether Altova UModel  Altova MapForce Altova StyleVision Server Altova MapForce Server Altova Authentic Aspose.Total for .NET Altova RaptorXML Server ComponentOne Ultimate Chart FX for SharePoint Chart FX CodeCharge Studio ComponentOne Enterprise combit Report Server Combit List & Label 22 Controls for Visual C++ MFC Chart Pro for Visual C ++ MFC DbVisualizer version 12.1 DemoCharge DXperience Subscription .NET DevExpress Universal Subscription Essential Studio for ASP.NET MVC FusionCharts Suite XT FusionCharts for Flex  FusionExport V2.0 GrapeCity TX Text Control .NET for WPF GrapeCity Spread Studio Highcharts Gantt Highcharts 10.0 版 HelpNDoc Infragistics Ultimate  ImageKit9 ActiveX ImageKit.NET JetBrains--Fleet JetBrains-DataSpell JetBrains--DataGrip jQuery EasyUI jChart FX Plus Nevron Vision for .NET OPC DA .NET Server Toolkit  OSS ASN.1/C Oxygen XML Author  OSS 4G NAS/C, C++ Encoder Decoder Library OSS ASN.1 Tools for C with 4G S1/X2 OSS ASN.1/C# OSS ASN.1/JAVA OSS ASN.1/C++ OPC HDA .NET Server Toolkit OPC DA .Net Client Development Component PowerBuilder redgate NET Developer Bundle Report Control for Visual C++ MFC  Altova StyleVision Sencha Test Stimulsoft Reports.PHP Stimulsoft Reports.JS Stimulsoft Reports.Java Stimulsoft Reports. Ultimate Stimulsoft Reports.Wpf Stimulsoft Reports.Silverlight SPC Control Chart Tools for .Net SlickEdit Source Insight Software Verify .Net Coverage Validator Toolkit Pro for VisualC++MFC TeeChart .NET Telerik DevCraft Complete Altova XMLSpy Zend Server

Dynamsoft Barcode Reader.NET

 

Barcode Recognition SDK - 1D, QRCode, DataMatrix, PDF417

Rapidly Implement Barcode Recognition to Your AppDynamsoft's Barcode Reader SDK enables you to efficiently embed barcode reading functionality in your web, desktop and mobile application using just a few lines of code. This can save you from months of added development time and extra costs. With the Barcode Reader SDK, you can decode barcodes from various image file formats (bmp, jpg, png, gif, single-page and multi-page tiff, and PDF). This includes from device-independent bitmap (DIB) formats which can be obtained from cameras or scanners.

Using Dynamsoft Barcode Reader .NET API in WinForms Application

Dynamsoft's Barcode Reader SDK provides .NET API which enables you to almost instantly embed barcode reading functionality in your .NET desktop or web applications using C# or VB.NET.In this video, I am going to demonstrate how to use the .NET barcode reading API to quickly build a WinFroms Application for 1D and 2D barcode recognition.

1.New a barcode project

First, let's create a new project. Click Templates -> Visual C# -> Windows -> Windows Forms Application. Change the name to BarcodeTest.

Drag a button to the form. And then double click to add code for its click event.

 

2.Add references

First, we need to add reference. Right click References to add Dynamsoft.BarcodeReader.dll.

The DLL can be found in the installation directory \Program Files (x86)\Dynamsoft\Barcode Reader 4.1\Components\DotNet.

3.Add namespace

Then, we add the namespace.

using Dynamsoft.Barcode;

4.Initiate Barcode

BarcodeReader reader = new BarcodeReader();

5.Barcode-reader-options

With the following snippet, we initialize the barcode reading options,

such as barcode types, how many barcodes to read per page etc.

ReaderOptions option = new ReaderOptions();

option.BarcodeFormats = BarcodeFormat.OneD;

option.MaxBarcodesToReadPerPage = 100;

reader.ReaderOptions = option;

6.Decode the barcodes

Call the DecodeFile method to decode the barcodes. If there are multiple barcodes found,

we use a loop to print out the results one by one.

 

try

{

  BarcodeResult[] results = reader.DecodeFile(@"D:\Program Files (x86)

  \Dynamsoft\Barcode Reader 4.1\Images\AllSupportedBarcodeTypes.tif");

  string strInfo = "Total barcode(s) found: " +

  results.Length.ToString() + ".\n";

  for (int i = 0; i < results.Length; ++i)

  {

    BarcodeResult barcode = results[i];

    strInfo += "Barcode " + (i+1).ToString() + ":\n";

    strInfo += barcode.BarcodeFormat.ToString() + "\n";

    strInfo += barcode.BarcodeText + "\n\n";

  }

  MessageBox.Show(strInfo);

}

  catch (BarcodeReaderException exp)

{

  MessageBox.Show("Error Code: " + exp.Code.ToString()

  + "\nError String: " + exp.Message);

}

7.Barcode Result

Build and debug the project.

Click the button. OK. We've got all the barcodes recognized.

 

Quick Navigation;

© Copyright 2000-2023  COGITO SOFTWARE CO.,LTD. All rights reserved