通用Windows应用程序中的图像解码条形码 [英] Decode Barcode from Image in Universal Windows App

查看:94
本文介绍了通用Windows应用程序中的图像解码条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Windows平板电脑上实现了一个通用的Windows应用程序(Windows 10)。这款平板电脑有相机,我想拍一张二维码的照片并对其进行解码。

I'm realize an universal windows app on windows tablet (windows 10). This tablet have camera and i want take a photo of qr code and decode it.


所以我尝试过Zxing.net,但是不起作用在通用Windows应用程序上。有一种解码foto内部qr代码的方法。

So i've tried with Zxing.net, but doesn't work on universal windows app. There's a method to decode a qr code inside a foto.

 var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
                var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
                var size = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor);

                CameraCaptureUI captureUI = new CameraCaptureUI();
                captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
                captureUI.PhotoSettings.CroppedSizeInPixels = new Size(size.Width, size.Height);

                StorageFile file = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);

                if (file != null)
                {
                    //QR code conversion from jepg and return string.
                }



我访问了一些链接...例如:  https://github.com/Redth/ZXing.Net.Mobile 

I've visited some links...for example: https://github.com/Redth/ZXing.Net.Mobile 



https://archive.codeplex.com/?p=zxingnet#trunk/Clients/WindowsRTDemo/Package.appxmanifest

https://archive.codeplex.com/?p=zxingnet#trunk/Clients/WindowsRTDemo/Package.appxmanifest


但是没有什么能用于通用Windows应用程序。解决方案?

But nothing work for universal windows app. Solutions ?

推荐答案

你好,

您可以尝试微软官方
条形码 
 扫描仪样本。

You can try Microsoft official barcode  scanner sample.


这篇关于通用Windows应用程序中的图像解码条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆