注:私の最初の質問は、ZXing C# ポートが信頼できるかどうかについてでしたが、ここでは、その使用方法を理解しようとしています。したがって、それらは重複していません。
ZXing C# モジュールを使おうとしていますが、うまくいきません。以前に ZXing を使用したことがある人は、正しく使用する方法を知っていますか? 残念ながら、C# のドキュメントは非常に小さいものです。
私の現在のコードは次のとおりです。
using com.google.zxing;
using com.google.zxing.client.j2se;
using com.google.zxing.common;
//...
Reader reader = new MultiFormatReader();
MonochromeBitmapSource image = new BufferedImageMonochromeBitmapSource(new Bitmap(Image.FromFile("barcode.jpg")),false);
Result result = reader.decode(image);
string text = result.getText();
sbyte[] rawbytes = result.getRawBytes();
BarcodeFormat format = result.getBarcodeFormat();
ResultPoint[] points = result.getResultPoints();
Console.WriteLine("barcode text: {0}", text);
Console.WriteLine("raw bytes: {0}", rawbytes);
Console.WriteLine("format: {0}", format);
Console.ReadLine();
「Result result = ...」で始まる行で例外が発生します。 ReaderException は次のように述べています。"Unable to cast object of type 'com.google.zxing.oned.MultiFormatOneDReader' to type 'com.google.zxing.Reader'.
それで、私は何を間違っていますか?
更新:提案されたアイデアを試すつもりですが、それまでの間、ZXing グループでこの問題を見つけました。