Using Unity QR Code scanning with ZXing, why isn't decoding working?

33 Views Asked by At

i am encountering problems with Unity QR code scanning. I am using Unity 2022.3 and ZXing for reading qr codes.

I have a script where i want to use an image of a qr code (loaded as public Texture2D qrCodeTexture;). After the barcodeReader.decode line, the code doesnt progress any further. ZXing dll for Unity is imported in Assets under Plugins. I dont get any errors in console.

Any ideas?

    void Start()
    {
        barcodeReader = new BarcodeReader();
        barcodeReader.Options = new ZXing.Common.DecodingOptions
        {
            TryHarder = true
        };

        camText.text = "Cam3";

        Result result = barcodeReader.Decode(qrCodeTexture.GetPixels32(), qrCodeTexture.width, qrCodeTexture.height);

        camText.text = "Cam4";
    }
0

There are 0 best solutions below