Page 1 of 1
Barcodes not being detected using SetRoi()
Posted: Wed Jul 14, 2010 4:27 am
by iaind
Hi, I have a number of documents with barcodes located in the same region (give or take a few pixels) on each page and am using SetRoi() to narrow down the barcode search...On the first 2 instances the barcodes are found without any problems but on the third and fourth instances (as well as others) the barcodes are only detected if I use a ResetRoi() instead of a SetRoi() even though they are in the same location as the first 2. Any ideas why this might be happening?
Thanks,
Iain
Re: Barcodes not being detected using SetRoi()
Posted: Wed Jul 14, 2010 9:00 am
by Loïc
Hi,
I don't get you dude. Could you explain what you mean by "if I use a ResetRoi() instead of a SetRoi() even though they are in the same location as the first 2. "
Also if you can attach image for investigation it should be helpful.
Kind regards,
Loïc
Re: Barcodes not being detected using SetRoi()
Posted: Mon Dec 13, 2010 5:28 pm
by jloizagah
Hi.
I think I must have the same problem. I'm trying to read a barcode selecting a region in a GdViewer, and works fine the first time, but if I select the same , or a similar zone containing the barcode, doesnt not read anythig. The code I'm using on the gdViewer1_MouseUp event of a GdViewer control is:
Code: Select all
private void gdViewer1_MouseUp(object sender, MouseEventArgs e)
{
try
{
if (this.gdViewer1.IsRect())
{
int LeftArea = 0;
int TopArea = 0;
int WidthArea = 0;
int HeightArea = 0;
this.gdViewer1.GetRectCoordinatesOnDocument(ref LeftArea, ref TopArea, ref WidthArea, ref HeightArea);
oGdPictureImaging.SetROI(LeftArea, TopArea, WidthArea, HeightArea);
if (oGdPictureImaging.Barcode1DReaderDoScan(ImageID, GdPicture.Barcode1DReaderScanMode.BestSpeed) == GdPicture.GdPictureStatus.OK)
{
int BarcodeCount = oGdPictureImaging.Barcode1DReaderGetBarcodeCount();
if (BarcodeCount > 0)
{
for (int i = 1; i <= BarcodeCount; i++)
{
if (oGdPictureImaging.Barcode1DReaderGetBarcodeType(i) == GdPicture.Barcode1DReaderType.Barcode1DReaderCode39)
MessageBox.Show("Value: " + oGdPictureImaging.Barcode1DReaderGetBarcodeValue(i));
}
}
else
{
MessageBox.Show("No Barcode");
}
oGdPictureImaging.Barcode1DReaderClear();
}
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
}
catch (Exception ex)
{
this.Cursor = Cursors.Default;
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
oGdPictureImaging.ResetROI();
gdViewer1.ClearRect();
}
}
There is also a tif file for testing purpouses.
Best regards.
Re: Barcodes not being detected using SetRoi()
Posted: Wed Dec 29, 2010 11:30 am
by Loïc
Hi,
This problem will be fixed for the next release.
Kind regards,
Loïc