0

我正在尝试在 Windows 8 应用程序中使用 ZXing https://zxingnet.codeplex.com/将字符串值转换为 PDF-417 条形码格式。目前我只能在下面编写如何将 BitMatrix 放入图像源的代码。

        int width = 115;
        int Height = 65;

        PDF417Writer writer = new PDF417Writer();
        BitMatrix bitIMGNew = writer.encode(value, BarcodeFormat.PDF_417, width, Height);
        WriteableBitmap imgBitmap = bitIMGNew.ToBitmap();

我怎样才能做到这一点?或者我需要使用任何其他 dll 吗?

4

1 回答 1

0

要使用 ZXing.Net 从某些内容生成 PDF417 代码,您应该尝试以下代码段:

var writer = new BarcodeWriter
{
   Format = BarcodeFormat.PDF_417,
   Options = new EncodingOptions {Width = 115, Height = 65}
};
var imgBitmap = writer.Write(value);

imgBitmap 是 WriteableBitmap 的一个实例,我认为它是您的图像源。

于 2013-06-21T19:11:49.160 回答