Google has a great barcode reading program/library in the form of ZXing. They had a CSharp branch already but not a Silverlight one. So I looked through the code a little and ported the QRCode portion of the library for Silverlight use by doing the following
- Replaced System.Collections.Arraylist with System.Collections.Generic.List <Object>
- Replaced System.Collections.HashTable with System.Collections.Generic.Dictionary <Object,Object>
- Removed all Serializable attribute markings
- Forced all calls to System.Text.Encoding to use UTF-8 as the encoding type.
While the first two changes might have a performance impact to the code, it's the LAST change that worries me since it deals with encoding, specifically I worry about exactly how well can the code deal with NON English content... oh well, that's a challenge for another day I guess.
What is that you say? Talk is cheap.. then GIVE IT A TRY!! How does it work? Create some tags.. save the tags as PNGs, then Read some tags by loading images which contains tags. Or.... Take a PICTURE of a tag using your webcam! Oh.. if your webcam can't take nice sharp images, you might want to invest in an autofocusing camera like the Microsoft LifeCam HD-5000.
What's that you say? It's an Open Source project therefore I need to contribute my code back into the trunk? Well.. sure... the source for the sample along with the lib is here.
The code was compiled for Silverlight 4, technically I don't *think* I used anything that won't allow it to work with Silverlight 3 though.
As to how to actually contribute it back in the trunk errr.. I guess I'll have to get in touch with the guys that's handling the project.
So.. 2 things that need to be done now.
- See how to integrate with RawVideoStream and read tags off a LIVE video stream
- See if the library works with Windows Phone 7
The 2nd would be a bit more difficult since I DON'T HAVE A WINDOWS PHONE 7 device! :P