Click here to Skip to main content
15,607,524 members
Articles / Programming Languages / C#
Technical Blog
Posted 26 Jan 2011


11 bookmarked

Reading Barcodes from Your WP7 Device

Rate me:
Please Sign up or sign in to vote.
4.43/5 (4 votes)
26 Jan 2011CPOL
Reading barcodes from your WP7 device

Barcode scanning doesn’t have loads of practical uses on a desktop (besides point-of-sale terminals), but on a mobile device, it’s a whole new ball game! Imagine a world where you can pick up an item, scan it with your phone and it gets delivered to your door… there are loads of scenarios where barcode scanning on your device makes sense! How difficult is it to do barcode scanning on a Windows Phone 7 device?

Introducing Windows Phone 7 Silverlight ZXing Barcode Scanning Library

“ZXing (pronounced "zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library originally implemented by Google in Java.”

To use this library is very simple, at the point where you want to scan the barcode, just call the following code:

WP7BarcodeManager.ScanBarcode((result) => 
    if (result.State == CaptureState.Success)

The result contains the details about the actual barcode and the state of the scanning process (if it succeeded or failed).

If you want the actual image of the barcode, do the following:

barcodeImage.Source = result.BarcodeImage;

P.S.: Don't forget to reference Silverlight_ZXing_Core.dll and WP7_Barcode_Library.dll.

And that’s it! Now you have full barcode support in your WP7 application, neat?


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

GeneralI need some more code on that, 10$ Pin
king'ori8-Mar-11 18:09
king'ori8-Mar-11 18:09 
I am new to windows phone programming.
I need a sample project (code), that can; Scan (1d) barcode to get the code then reference database to check if the code exists.

Kindly assist, willing to compensate 10$ right away for the effort.

Generalthanks for sharing - have 5 Pin
Pranay Rana26-Jan-11 20:45
professionalPranay Rana26-Jan-11 20:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.