Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

It's three-for-one QR Code Day

Today's Mobile Monday post isn't one project, but three. Yep, it's a three for one day...

image

We've all seen QR codes around, they are appearing on sites, in print, on TV and even tattoos. Four months ago we covered one way to consume them in a Windows Phone 7.1(5) app, Window Phone 7.5, ZXing and QR codes. Today we're going to highlight three other QR Code projects, one that will help you create them and two other ways to consume them in Windows Phone 7.1(5) apps.

QrCode.Net

Project Description
The goal of the project is provding an easy to use, fully managed .Net library for handling QR code according to ISO/IEC 18004. Following features are planned: encoding, rendering (to: screen, file & stream), decoding, detection & recognition, artistic QR code.

The Goal of the Project

The goal of the project is to provide an easy to use, managed .Net library for:
  1. Crating QR code bit matrix from text – encoding.
  2. Rendering of QR code bit matrix to screen, into an image file or stream.
  3. Rendering of so called "artistic" QR codes (see below).
  4. Decoding QR code given as bit matrix.
  5. Detection and recognition of QR code captures.
  6. The library should support Windows Phone 7 and Silverlight

 

Just launched another open source project QrCode.Net at qrcodenet.codeplex.com

Background

Recently I was looking for a .NET implementation of QR code generator. Most of components either use online services to generate and/or recognize QR code or the implementation was not “good enough” for my purposes. The most popular and very powerful Java implementation comes from google’s open source project code.google.com/p/zxing called ZXing (Zebra Crossing => Z=Zebra + X=Cross + ing).

There I found a one-to-one c# port of earlier version. The project is focusing on additional features and further development in Java so it seems that no one is taking care of c# branch.

Thus I have decided to set-up this project QRCode.Netqrcodenet.codeplex.com.

As a start point I took a straight forward c# port of google’s QR code implementation from ZXing project.
I wrote a wrapper around and a demo application which is able to generate QR code from text as you type and save it to file.

In addition it contains a very naive and simple implementation of Artistic QR code generation. At the highest error correction level it is possible to create artistic QR codes that still scan correctly, but contain intentional errors to make them more readable or attractive to the human eye, as well as to incorporate colors, logos and other features into the QR code block.

Here's a snap of the app running;

SNAGHTML2445fc27

And the Solution from the latest check-in (which ran for me the first time with no issues);

imageimageimage

Now that we've generated a QR Code, let's look at reading it...

Creating a QR Code Reader App for Windows Phone 7

If you’ve updated Windows Phone 7.5, you might have noticed that it has some nice built-in functionality for reading QR Codes using Bing Vision search. After trying it out for a while, I pretty quickly started wondering how I could use this in an app, and equally quickly I was disappointed to find that there are no APIs available for 3rd party developers to access this feature.

After a short hunt online, I found an excellent library that can be used as an alternative, and I built a simple reader with it. Here are the basic steps to create one yourself:

  • Create a new Windows Phone Project in Visual Studio
  • Update the App Manifest
  • Create the QR Reader Window and Output Area
  • Directives and Variables
  • Handle Navigation
  • Add Camera Event Handlers
  • Download the Barcode Library
  • Add the Barcode Library to the Project
  • Decode the QR Code Image
  • Compile and Deploy

imageimage

This project used a barcode library that I don't think I've seen before, messagingtoolkit-barcode

MessagingToolkit Barcode library is a C# barcode library that can be used in standalone Windows applications, ASP.NET web applications, and Windows Phone 7 applications.

image

The library current supports encoding and decoding of the following barcode types

Encoding
  • QR Code
  • Data Matrix
  • PDF 417
  • Bookland/ISBN
  • Codabar
  • Code 11
  • Code 128
  • Code 128-A
  • Code 128-B
  • Code 128-C
  • Code 39
  • Code 39 Extended
  • Code 93
  • EAN-13
  • EAN-8
  • FIM
  • Interleaved 2 of 5
  • ITF-14
  • LOGMARS
  • MSI 2 Mod 10
  • MSI Mod 10
  • MSI Mod 11
  • PostNet
  • Standard 2 of 5
  • Telepen
  • UPC 2 Digit Ext.
  • UPC 5 Digit Ext.
  • UPC-A
  • UPC-E
Decoding
  • UPC-A
  • UPC-E
  • EAN-8
  • EAN-13
  • Code 39
  • Code 93
  • Code 128
  • QR Code
  • ITF
  • Codabar
  • RSS-14
  • Data Matrix
  • PDF 417
  • Aztec

This library is based on the zxing library, with some additional features not available in the original code. You can freely use it for non-commercial purpose. To use it commercially, please consider making a payment to support this project here

And last, but not least, our third project of the day, a simple and re-usable QR Code control that makes adding QR Code consumption to your Windows Phone 7.1(5) app drag-n-drop easy

A simple Windows Phone control for reading QR codes

There are great libraries out there written or ported to C# that let us developers rock by standing on the shoulders of giants. Here’s one such project.

A phone developer who’s also an enthusiast of foursquare suggested a feature that I should add in a future release, and provided some sample code based on the zxing barcode library and the Silverlight port of it. I’m working on adding the new feature soon.

In the process I realized it would be a good and quick opportunity to ship such a simple but useful control to the phone development community, so I’ve gone ahead and pushed that control refactoring and implementation to GitHub, check it out: https://github.com/jeffwilcox/wpqr-control

Special thanks to Michael Osthege (@theCake, blog) for providing the initial contact, sample, and encouragement.

The control is nice:

  • Drop it on the design surface
  • Wire up the ScanComplete event (and optionally the Error event)
  • The control handles all the underlying image manipulation, scanning work, PhotoCamera initialization, etc.

Here’s what a simple sample app looks like in use. The control includes default border thickness and coloring properties that use the accent color and provide a nice visual separator:

  • image
  • ...
    Building the sample app

    All I did to build this app was drop the control into a new Windows Phone app project and wire it up. Here’s how.

    image

Hopefully, with these three projects and the information and resources they provide, adding QR Code support to your apps should now be that much easier...

Tags:

Follow the Discussion

  • Thank's, you help me with a lot of questions.

  • Kelly JonesKelly Jones

    Perfect post. Learn how to incorporate QR codes in your web apps to deliver quick information directly to your users' mobile device http://blog.caspio.com/web_apps/4-ways-to-use-qr-codes-in-your-web-apps/

  • keepdynamickeepdynamic

    thx for sharing! one more qr code reader: http://www.keepdynamic.com/csharp-barcode-reader/qr-code.shtml

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.