Reputation: 5924
I have a Windows Store (Metro) application. I need to add support for scanning barcodes.
I tried using ZXing first. From what I was able to get working, you actually need to click and save an image for it to do the processing. There's no nice overlay of a red line "scanner" nor does it process a live feed. This isn't a very elegant solution. It works far better on Android. Basically, this won't work as I need a constant video and a constant search for a barcode to be in focus.
This blog (http://www.soulier.ch/?p=1275&lang=en) mentions that extrapolating a frame out of a WinRT video stream is not allowed in managed code which means I'd need to use C++.
So, are there any components out there that do this? Anything free or paid that I can get that would be written in C++ and can find and extrapolate a barcode? Learning C++ is not on my bucket list.
Upvotes: 0
Views: 919
Reputation: 715
I made a lib for WinRT using ZXing & Imaging SDK. It works well (but does not include any additional focus feature). There is a lib and a sample app that you can try. It works for barcodes and QRCode (barcode by default but just change the optional parameter in the scan function code to use QRCode)
Upvotes: 0
Reputation: 31724
You can capture frames while displaying a preview with C# only. Here's an example control that does it:
Basically you need to create a MediaCapture
object and associate it with a CaptureElement
control to display the preview. Then you can use CapturePhotoToStreamAsync()
to capture a frame to a stream of your selected encoding format and then have a go at it with your bar code reading code.
Upvotes: 1