BarCode Reader SDK Usage Tutorial: How to read barcodes from images

Source: Internet
Author: User

We know that many languages can read barcodes on the Windows platform, and today we will share in the Barcode Reader SDK How to read barcodes in images with vb.net or C #.

"BarCode Reader SDK Download"

This code demonstrates how to read barcodes from an image and print to the output console.

Visual Basic. NET:

imports system.ioimports bytescout.barcodereader  '  requiring to install  evaluation or full version of barcode reader sdk<em>module < font class= "Apple-style-span"  color= "#000000" ><span data-scayt_word= "Module1"   Data-scaytid= "1" >module1</span></font></em>sub main () dim pat as  string =  "Inputphoto.jpg" Console.WriteLine ("Reading barcode (s)  from image {0}",  path.getfullpath (PAT)) dim <span data-scayt_word= "BC"  data-scaytid= "2" >bc</span > as new reader () BC. Typetofind = symbologyfilter.findalldim barcodes as <span data-scayt_word= " Foundbarcode " data-scaytid=" 3 ">FoundBarcode</span> ()  = bc. Readfrom (PAT) dim i as integerfor i = 0 to barcodes. Length - 1console.writeline ("found barcode with type  ' {0} '  and value  ' {1} ',  barcodes (i). Type, barcodes (i). Value) Nextconsole.writeline ("Press any key to exit..") Console.readkey () End subend module

C #

Using system;using system.collections.generic;using system.text;using system.io;using  Bytescout.BarCodeReader; // requires to have evaluation or full  Version of barcode reader sdk installed<span data-scayt_word= "Namespace"  data-scaytid= "6" >namespace</span> <span data-scayt_word= "SimpleTestSharp"   Data-scaytid= "7" >simpletestsharp</span>{class program{<span data-scayt_word= "Const"  data-scaytid= "8" >const</span> string path =  "<span data-scayt_word=" "Inputbarcodeimagejpg"  data-scaytid= "9" >InputBarcodeImagejpg</span> "Static void main ( string[] <span data-scayt_word= "args"  data-scaytid= ">args</span>" { Console.WriteLine ("Reading barcode (s)  from image {0}",  path.getfullpath (Path)); reader <span data-scayt_word= "BC" &NBsp;data-scaytid= ">bc</span> = new reader" (); <span data-scayt_word= " Foundbarcode " data-scaytid=" "&GT;FOUNDBARCODE&LT;/SPAN&GT;[]&NBSP;BARCODES&NBSP;=&NBSP;BC". Readfrom (path); <span data-scayt_word= "foreach"  data-scaytid= ">foreach</span> " ( <span data-scayt_word= "Foundbarcode"  data-scaytid= ">foundbarcode</span> barcode"  in barcodes) Console.WriteLine ("found barcode with type  ' {0} '  and  value  ' {1} ',  barcode. Type, barcode. Value); Console.WriteLine ("Press any key to exit."); Console.readkey ();}}}
This article is translated from barcode Reader


This article is from the "294936239" blog, please be sure to keep this source http://294936239.blog.51cto.com/10806039/1707808

BarCode Reader SDK Usage Tutorial: How to read barcodes from images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.