Skip to content
Discussion options

You must be logged in to vote

Following up here. I stopped trying to do the work Async and the issue went away. Here is a complete helper which works in WinAppSDK if anyone wants to copy/paste.

using Microsoft.UI.Xaml.Media.Imaging;
using System.Drawing;
using System.Drawing.Imaging;
using ZXing.Common;
using ZXing.QrCode.Internal;
using ZXing.Windows.Compatibility;

public static class BarcodeHelpers
{
    public static BitmapImage GetQrCodeBitmapFromText(string text, ErrorCorrectionLevel correctionLevel)
    {
        BitmapRenderer bitmapRenderer = new();
        bitmapRenderer.Foreground = Color.Black;
        bitmapRenderer.Background = Color.White;

        BarcodeWriter barcodeWriter = new()
        {
         …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@micjahn
Comment options

Answer selected by TheJoeFin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants