|
Hello,
I am using Lead Tools 14.0
I am using the LEADBarCode ocx to read the barcode for the batch scanner.
I user the following code
-----------------------------
private AxLTBARLib.AxLEADBarCode MyBarCode;
COLOREDIMAGE.Bitmap = 0;
COLOREDIMAGE.Load(coloredPath, 24, 1, 1);
COLOREDIMAGE.Sharpen(( short)PIC_SHARPEN);
if (!readColored)
{
COLOREDIMAGE.ColorRes(1, ( int)LEADLib.ColorResPaletteConstants.CRP_FIXEDPALETTE, (int)LEADLib.ColorResDitherConstants.CRD_NODITHERING, 0);
}
MyBarCode.EnableUseRegion = false;
MyBarCode.EnableUseColors = false;
MyBarCode.Bitmap = COLOREDIMAGE.Bitmap;
MyBarCode.ReadFlags = 0;
MyBarCode.Units = ( int)tagBARCODE_UNITS.BARCODE_SCANLINES_PER_PIXELS;
MyBarCode.PDFRead.Direction = 255; //(int)tagBARCODE_DIRECTION.BARCODE_DIR_LEFT_TO_RIGHT;
int ret = MyBarCode.Read((int)tagBARCODE_PDF_TYPES.BARCODE_PDF417, 1,
0, 0,
0, 0);
if (ret == 0)
{
string dt = MyBarCode.get_BarCodeData(0).Data;
......
-----------------
The problem is the function MyBarCode.Read is not respoding sometimes, after control passed to the function it will not respond with any data but just hang. Do you any solution for this or what is the reason. If it happens I have close and start the application again.
|