1
People I developed this barcode reader in C# using Zxing , it reads the barcode of an img and then it takes the image number , moves the image to another folder and renames the image with the barcode number
//Esse é o método pra ler a imagem
Bitmap image;`
image = (Bitmap)Bitmap.FromFile(recebe);
LuminanceSource source;
source = new BitmapLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
Result result = new MultiFormatReader().decodeWithState(bitmap);
//faz um condicional para ler o que existe dentro da matriz Barcode
foreach (string code in result)
{
if (!Directory.Exists(nomePasta.ToString()))
{
Directory.CreateDirectory(nomePasta.ToString());
}
else
{
}
if (codigo == 0)
{
codigo = Convert.ToInt32(0 + code);
File.Move(stringCaminho.ToString(), nomePasta.ToString() + code + ".bmp");
}
else if (codigo + 0 > Convert.ToInt32(0 + code))
{
MessageBox.Show("Código de barras está errado! "+code);
}
dataGridView1.Rows.Add(code);
//esta dando erro para fazer o Move da segunda referencia
}
}
The problem is that when he reads the barcode he always brings the first wrong number, and the others he brings it right, which I can do?
Based on what are you saying the first number is wrong? What format is identified (Result Barcodeformat property ?
– Anderson Pimentel
The code is working . beauty , however it does not read the right first number . It will dll error even ?
– Yuri Ancelmo
I think it might be a problem in the library. I downloaded a reader for Windows Phone based on this library and it gives several random results. It’s very inconsistent.
– Anderson Pimentel