This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, November 30, 2009 4:54:38 PM(UTC)
Groups: Registered
Posts: 10
Basically, I need to read a barcode from a bitmap file. I'm using Powerbuilder and calling the API. I find it hard to get the BITMAPHANDLE. Is it supposed to show pBitmap.Flags.Allocated=1 if I'm successful? The L_LoadBitmap says my structure size is incorrect -789.
I've also installed the ActiveX object. Is there a simple method of obtaining the BITMAPHANDLE from that?
#2
Posted
:
Wednesday, December 2, 2009 5:50:58 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
In LEADTOOLS 16.5, the size of the BITMAPHANDLE structure is 208 bytes (Unicode) or 176 bytes (ANSI). If you are passing a different size in the BITMAPHANDLE.uStructSize member or in the structure size parameter of the function, it will fail.
If your structure has a different size, you probably defined some of its members incorrectly.
About the Flags member, it's a special type of structure members called Bit Field. Basically, every flag will take one bit, for a total of 17 bits for the 17 flags defined in the structure. To round the member size to 32 bits, a dummy flag of size 15 bits is added at the end.
About accessing the internal bitmap handle of the LEAD Main OCX, you can use the 2 functions L_GetControlBitmap and L_SetControlBitmap defined in the DLL file LTOCXU.OCX itself. I don't have PowerBuilder declarations for these functions, but their VB6 declarations are:
Declare Function L_GetControlBitmap Lib "LTOCXU.OCX" (Ctrl As Object, hBitmap As LEADBitmapHandle) As Long
This function copies the image in the LEAD control to a LEAD BitmapHandle. The LEAD BitmapHandle can be released after this copy if it is not required. The function returns TRUE or ERROR CODE.
Declare Function L_SetControlBitmap Lib "LTOCXU.OCX" (Ctrl As Object, hBitmap As LEADBitmapHandle) As Long
This function sets the LEAD control with the image referenced by the LEAD BitmapHandle. The LEAD BitmapHandle can be freed after this copy if it is not required. The function returns TRUE or ERROR CODE.
#3
Posted
:
Wednesday, December 2, 2009 5:44:20 PM(UTC)
Groups: Registered
Posts: 10
Thanks for the response. Could you give me the sizeof the following structures for my reference too? Thanks.
L_LoadBitmap ( ....pLoadOptions, pFileInfo )
#4
Posted
:
Thursday, December 3, 2009 5:54:10 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
LOADFILEOPTIONS is 44 and FILEINFO is 2200 (Unicode).
You can check them using sizeof() operator.
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.