Hi,
I am using Leadtools 14.5 with VS 2003. When using AxLTBARLib.AxLEADBarCode control in C#.net,
I have five questions about the issue of using barcode module in C#.net
(1) We need to convert a image to ocxbitmp with the following command:
IntPtr ocxBitmap = RasterImageConverter.ToLeadBitmap(image, "LTKRN14N.DLL");
After finishing barcode reading, free memory of the ocxbitmp must be done. I saw some users posting
source code in leadtools forum and use the following two statements to do memory free operation:
RasterImageConverter.FreeLeadBitmap(ocxBitmap, "LTKRN14N.DLL");
System.Runtime.InteropServices.Marshal.FreeHGlobal(ocxBitmap);
Must two statements must be executed? or only RasterImageConverter.FreeLeadBitmap(ocxBitmap, "LTKRN14N.DLL") should be called?
(2) Must the kernal DLL name must be matched in both ToLeadBitmap() and FreeLeadBitmap()?
(3) For these statements
------------
IntPtr ocxBitmap = RasterImageConverter.ToLeadBitmap(image, "LTKRN14N.DLL");
leadbarcode.Bitmap = ocxBitmap.ToInt32();
leadbarcode.EnableMethodErrors = false;
leadbarcode.EnableUseRegion = false;
RasterImageConverter.FreeLeadBitmap(ocxBitmap, "LTKRN14N.DLL");
System.Runtime.InteropServices.Marshal.FreeHGlobal(ocxBitmap);
leadbarcode.Linear.EnableErrorCheck = true;
leadbarcode.Linear.Granularity = 9;
leadbarcode.Linear.MinLength = 3;
leadbarcode.Linear.WhiteLines = 3;
leadbarcode.Linear.ReadDirection = read_direction;
int rtncode = leadbarcode.Read(BARCODE_1D_CODE_3_OF_9, 0, 0, 0, 0, 0);
------------
The above statements were executed without problem, why RasterImageConverter.FreeLeadBitmap()
can be called before leadbarcode.Read() is executed? Should the memory statements be called after
all barcode reading operations are done.
(4) There are two kernal DLL names for used in RasterImageConverter.ToLeadBitmap()
"LTR14N.DLL" (COM) and "LTKRN14N.DLL" (ACTIVEX)
For AxLTBARLib.AxLEADBarCode activeX control, I think "LTKRN14N.DLL" should be used, how about
LTBARLib.LEADBarCode?
(5) Is LTBARLib.LEADBarCode a COM object?
Thanks for your kind attention to answer these questions,
Raymond