Encoding QR码编解码问题

Encoding QR码编解码问题,encoding,decoding,docx,qr-code,Encoding,Decoding,Docx,Qr Code,我想要分割一个文件(docx文件),并使用文件的各个片段来编码QRCode,这样当按顺序读取QRCode时,它会复制原始文件 我能够分割文件并创建一组QRCODE,但是当尝试重新创建文件时,解码器抛出以下错误消息 “检测到的查找程序模式数无效” 我正在使用图书馆 我的编码器代码 私有列表编码(字符串内容、编码、整数 System.Drawing.Color QRCODE背景色, QRCodeCapacity,System.Drawing.Color qrCodeBackgroundColor,S

我想要分割一个文件(docx文件),并使用文件的各个片段来编码QRCode,这样当按顺序读取QRCode时,它会复制原始文件

我能够分割文件并创建一组QRCODE,但是当尝试重新创建文件时,解码器抛出以下错误消息

“检测到的查找程序模式数无效”

我正在使用图书馆

我的编码器代码

私有列表编码(字符串内容、编码、整数 System.Drawing.Color QRCODE背景色, QRCodeCapacity,System.Drawing.Color qrCodeBackgroundColor,System.Drawing.Color

qrCodeForegroundColor、int qrCodeScale、int NoOfQRcodes)

{

listqrcodesimages=newlist();
byte[]\u filebytearray=encoding.GetBytes(content);
for(int k=0,l=0;k
能否请您发布生成图片的最小示例?(请使用最小的docx文件)。最好使用utf-8编码的文本文件作为输入//梅塔:我真的希望这是一个评论,但我不能这样做。请随时告诉我。实际上问题出在二维码库上。我使用的是CodeProject中的QRCodeLib,当每个QRCode中填充的数据量几乎等于其最大容量时,它在解码QRCode时抛出错误。我从谷歌转到了ZXing,它工作得很好。谢谢你的评论。你能发布一个生成图片的最小示例吗?(请使用最小的docx文件)。最好使用utf-8编码的文本文件作为输入//梅塔:我真的希望这是一个评论,但我不能这样做。请随时告诉我。实际上问题出在二维码库上。我使用的是CodeProject中的QRCodeLib,当每个QRCode中填充的数据量几乎等于其最大容量时,它在解码QRCode时抛出错误。我从谷歌转到了ZXing,它工作得很好。谢谢你的评论。。
      List<Bitmap> _qrcodesImages = new List<Bitmap>();

      byte[] _filebytearray = encoding.GetBytes(content);

      for (int k = 0,l=0; k < NoOfQRcodes; k++)
      {
          byte[] _tempByteArray = _filebytearray.Skip(l).Take(QRCodeCapacity).ToArray();
          bool[][] matrix = calQrcode(_tempByteArray);

          SolidBrush brush = new SolidBrush(qrCodeBackgroundColor);
          Bitmap image = new Bitmap((matrix.Length * qrCodeScale) + 1, (matrix.Length * qrCodeScale) + 1);
          Graphics g = Graphics.FromImage(image);
          g.FillRectangle(brush, new Rectangle(0, 0, image.Width, image.Height));
          brush.Color = qrCodeForegroundColor;
          for (int i = 0; i < matrix.Length; i++)
          {
              for (int j = 0; j < matrix.Length; j++)
              {
                  if (matrix[j][i])
                  {
                      g.FillRectangle(brush, j * qrCodeScale, i * qrCodeScale, qrCodeScale, qrCodeScale);
                  }
              }
          }
          _qrcodesImages.Add(image);
          l += QRCodeCapacity;
      }

      return _qrcodesImages;
  }