I'm trying to use zxing.net in a test project, this is my code:
protected void Button1_Click(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
Bitmap bitmap = new Bitmap(Server.MapPath(Image1.ImageUrl));
BarcodeReader reader = new BarcodeReader
{
AutoRotate = true,
TryInverted = true,
Options = new ZXing.Common.DecodingOptions
{
TryHarder = true,
PossibleFormats = new List<BarcodeFormat>
{
BarcodeFormat.EAN_13
//BarcodeFormat.QR_CODE
}
}
};
Result result = reader.Decode(bitmap);
string decoded = "???";
if (result != null)
{
decoded = result.ToString().Trim();
}
this.TextBox1.Text = decoded;
}
}
This return always null... why? ean.png is the following: ean13 sample
Thank you very much.