0
我试图从下面的代码片段的图像读取IMB条码,但它总是返回null。我也在下面的黑匣子测试中尝试了IMB条形码图像,但不起作用。无法读取IMB条码
https://github.com/micjahn/ZXing.Net/tree/master/Source/test/data/blackbox/imb-1
private static void Decode()
{
Bitmap bitmap = new Bitmap(@"\07.png");
try
{
MemoryStream memoryStream = new MemoryStream();
bitmap.Save(memoryStream, ImageFormat.Bmp);
byte[] byteArray = memoryStream.GetBuffer();
ZXing.LuminanceSource source = new RGBLuminanceSource(byteArray, bitmap.Width, bitmap.Height);
var binarizer = new HybridBinarizer(source);
var binBitmap = new BinaryBitmap(binarizer);
IMBReader imbReader = new IMBReader();
Result str = imbReader.decode(binBitmap);
}
catch { }
}
...你从这里得到:https://github.com/micjahn/ZXing.Net/issues/59 ;) – Michael
是,此代码的工作 - 感谢的解决方案。我在上述更新中添加了参考链接。 – Karthikeyan