ファイル(docxファイル)を分割し、ファイルの個々のフラグメントを使用してQRコードをエンコードし、qrコードを順番に読み取ったときに元のファイルを再現したいと考えています。
ファイルを分割して一連の QRCode を作成することはできましたが、ファイルを再作成しようとすると、Decoder は次のエラー メッセージをスローします。
「無効なファインダ パターン数が検出されました」
http://www.codeproject.com/KB/cs/qrcode.aspxライブラリを使用しています。
私のエンコーダーコード
private List Encode(String content, Encoding encoding, int System.Drawing.Color qrCodeBackgroundColor, QRCodeCapacity,System.Drawing.Color qrCodeBackgroundColor,System.Drawing.Color
qrCodeForegroundColor,int qrCodeScale, int NoOfQRcodes)
{
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;
}