我正在使用ZXing.Net.Mobile並具有以下代碼來掃描QR代碼。QR代碼掃描在UWP中不起作用
await scanner.Scan().ContinueWith(t =>
{
if (t.Result != null)
HandleScanResult(t.Result);
});
scanner.UseCustomOverlay = false;
scanner.ScanContinuously(async (res) =>
{
var msg = "Found Barcode: " + res.Text;
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
{
ViewHelper.showMessage(msg, "");
});
});
我試過了ContinueWith和ScanContinuosly,但都沒有工作。 我使用紅線獲取相機視圖,但不掃描QR碼。
我在哪裏出錯了。
第一行代碼困擾了我很多 – Alex
好吧,我解決了這個問題,通過手動卸載nuget並添加所需的項目https://github.com/Redth/ZXing.Net.Mobile。 也更新了Microsoft.NetCore.UniversalWindowsPlatform。我猜目前的nuget包存在一些問題。希望他們解決這個問題 – AbsoluteSith