Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Saturday, January 13, 2007 4:46:15 PM(UTC)
Raymond Lee

Groups: Registered
Posts: 30


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

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, January 21, 2007 10:48:40 PM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)






Raymond,






1. You must use the two statements.
2. Yes, the same file






3. Yes it can be freed, because the barcode control already has a copy of the image.
When the barcode control finishes, it will automatically free this second copy, so you don't need to worry about it.




4. For LEAD Barcode object, the kernel is always LTKRN14N.DLL. It doesn't matter if you put it on a form or create it by code.






5. The LEAD barcode object is a full ActiveX control.
But ALL ActiveX controls are COM objects, so this means technically, yes it is a COM object.


Please note that the distinction we make between LEAD Main
OCX and related controls (Dynamic group) and between LEAD Raster COM objects
(Static group) does not mean the Main OCX and other controls are not COM. It
only means they are 2 separate groups of objects, and you can use one group or the other.




The design of the Raster COM group is a little more advanced, and they generally contain more features.
Some objects (such as Twain) have 2 different editions, where the Dynamic edition object name has an added _D.


Other objects, such as Barcode, have only one edition, and it can be used with both groups.


 

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.064 seconds.