This project has moved and is read-only. For the latest updates, please go here.

Use BitmapImage instead of Bitmap

Nov 7, 2013 at 5:49 PM
I can't claim to have actually used it yet, but one of the reasons I found ZXing.NET is because I was looking for a QR Code decoder that I could use in a Windows Store App that did not use the Bitmap type, since it is not available in Windows 8.1. I was hoping for something that used the BitmapImage type, so I would like to see, in future versions, Bitmap replaced with BitmapImage. Just a suggestion.
Nov 12, 2013 at 8:27 PM
There are special builds for nearly all different .Net platforms.
For example if you use it with silverlight than uses the WriteableBitmap class.
The Bitmap class is only used with the "normal" standard .Net framework.
There is a special build for Windows Store Apps available which uses WriteableBitmap and raw RGB byte array data.
The portable version uses a byte array with raw RGB data. The Unity3D version supports Color32.
For MonoTouch/Xamarin it uses UIImage.

So I think there is nearly everything available which is needed. If you want a direct BitmapImage support feel free to provide a patch.
You only have to write a new LuminanceSource class which takes a BitmapImage and convert it to an array with the luminance data.
Nov 12, 2013 at 11:59 PM
OK, that's good to know. But where can I get the different builds? On the home page at there is a download button, but no links to the different builds. Thank you.
Nov 15, 2013 at 8:59 PM
I have managed to download and have tried to use it. I am using the zxing.winrt.dll assembly (since I did not see a dll in the Windows Store Demo directory), but I receive the following error:

'FormatException' is ambiguous, imported from the namespaces or types 'ZXing, System'.

Because I have not yet added any code of my own that attempts to use ZXing, I know the problem is not in the code I have written. Am I using the wrong assembly? What should I do about this error? Thanks.
Nov 17, 2013 at 8:00 PM
All builds and binaries can be found in the download section in the archive
Please try the WinMD assembly from the archive.
There is a conflict with the type "FormatExeption". That one exists in the namespace "ZXing" and "System".
You should not use "using ZXing;" in that case.
Nov 19, 2013 at 2:47 AM
What do you mean by "Please try the WinMD assembly from the archive."? I saw the ZXing.winmd file, but what am I supposed to do with it (assuming this is what you were referring to)? It is not a .dll (unless I am supposed to rename it), so it is not an assembly. I have never seen or heard of a winmd file before, I was expecting to get a .dll assembly to reference from my project. Is a *.dll not what you are giving for the WindowsStoreDemo client? I'm not exactly sure what to do. Thanks.
Nov 19, 2013 at 3:22 PM
A WinMD file is ".Net assembly for Windows Store Apps". Please take a look at wikipedia for further information:
MSDN information:
And something more from codeproject:

The WindowsStoreDemo uses the winmd assembly. The WindowsRTDemo uses the winrt assembly but it can't be used with the appstore. It only uses the windows runtime.

A suggestion: Download the complete source code from the download section and open the project for the WindowsStoreDemo. Look at the references and the sample code. It should make things clear.