IC Barcode

Getting Started with the TIS Barcode SDK in .Net

Getting Started with the TIS Barcode SDK in .Net

This chapter shows how to get started with the TIS Barcode SDK using the .Net component.

Requirements

  • Microsoft Visual Studio 2008 or later

Step 1: Create the project

Create a new C# project, select Windows Forms Application.

image

Step 2: Add the TIS Barcode SDK reference

In order to add the TIS Barcode SDK reference, right click the Reference folder in the solution view and choose Add Reference....

image

Select the Browse tab in the Add Reference dialog box. Then click Browse... and select documents\Tis Barcode SDK\bin\dotnet\v2.0\x86\TIS.Imaging.Barcode.dll from the Barcode SDK installation directory.

image

Step 3: Configuring the BarcodeScanner object

Add the TIS Barcode SDK namespace to the list of using directives at the top of your source code file.

[C#]
using TIS.Imaging.Barcode;

The BarcodeScanner class provides the main functionality for barcode recognition.

[C#]
// Creating the BarcodeScanner instance private BarcodeScanner _scanner = new BarcodeScanner(); private void Form1_Load(object sender, EventArgs e) { // Enable optional checksum. _scanner.Options.EnableCheckSum = true; // Specify supported formats. _scanner.Options.SupportedTypes.Add(BarcodeFormat.CODE_39); _scanner.Options.SupportedTypes.Add(BarcodeFormat.CODE_128); }

Step 4: Barcode Recognition

The barcode recognition is performed automatically using the BarcodeScanner instance. Calling the FindBarcodes method starts the recognition process and returns an array of BarcodeResult objects containing the recognized barcodes.

[C#]
private void PrintBarcodes(Bitmap image) { var results = _barcodeScanner.FindBarcodes(image); if(results != null) { foreach( var result in results) { System.Console.WriteLine(result.Text); } } }

<< Programmer's Guide

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us