title: Can ZXing.NET read multiple QR barcodes in same image?
body: <p>I'm in the process of integrating ZXing.NET into a WPF application but I'm using the BarcodeReader.Decode method to read the QR barcode. It works but now I'm wondering what happens when the image have multiple QR barcodes. I want ZXing to read them all into an array. Is this possible? If yes, how? I don't see any method that does this.</p>
  
  <p>Edit:
  I found out there is a class called QRCodeMultiReader that I can use to read multiple QR barcodes. But the parameter that you send to the decodeMultiple method is of type ZXing.BinaryBitmap. How do I convert a Bitmap into a BinaryBitmap?</p>
  
  <p>Here is what I have, but the results variable is always null when I call decodeMultiple:</p>
  
  <pre><code>public static List&lt;BarCodeDataContract&gt; MultipleDecode(Bitmap image)
  {
      var converter = new ImageConverter();
      var bytes = (byte[])converter.ConvertTo(image, typeof(byte[]));
      LuminanceSource source = new RGBLuminanceSource(bytes, image.Width, image.Height);
      var binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));
  
      var reader = new QRCodeMultiReader();
      var results = reader.decodeMultiple(binaryBitmap);
      var scannedQrBarcodes = new List&lt;BarCodeDataContract&gt;();
  
      foreach (var result in results)
      {
          if (result == null || result.BarcodeFormat != BarcodeFormat.QR_CODE || !result.Text.Contains(":")) return null;
  
          var qrCodeData = result.Text.Split(':');
          if (qrCodeData.Length != 2) return null;
  
          int numericCode;
          if (int.TryParse(qrCodeData[0], out numericCode))
          {
              if (System.Enum.IsDefined(typeof(QrCodeActionPrefixType), (short)numericCode))
              {
                  Guid guid;
                  if (Guid.TryParse(qrCodeData[1], out guid))
                  {
                      scannedQrBarcodes.Add(new BarCodeDataContract()
                      {
                          QrCodeActionPrefixType = (QrCodeActionPrefixType)numericCode,
                          BarCodeObjectUniqueId = guid
                      });
                  }
              }
          }
      }
      return scannedQrBarcodes;
  }
  </code></pre>