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 : Thursday, June 1, 2006 4:40:21 AM(UTC)
DannyKao

Groups: Registered
Posts: 3


Dear Sir,

   i am using version 14.0 API.

   can i add a page(image) into document L_HDoc without using pBITMAPHANDLE (created by L_LoadBitmap) ?

    because i will do image segmentation in advance.

    or is there anyway that i can convert an byte array to pBITMAPHANDLE ?

    i don't want to save my raw data to a image file and call LoadBitmap to load that file again....

   

 

 

 

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, June 4, 2006 11:38:22 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

The L_DocAddPage takes the pBITMAPHANDLE as a parameter for the new page to insert into the OCR list pages.
So you can't add a new document page without using a valid bitmap handle (pBITMAPHANDLE).
About loading a bitmap from a byte array, you can try to use the L_LoadBitmapMemory function, which loads an image file from memory into a bitmap. The file in memory can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Please let me know how it goes.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Monday, June 5, 2006 1:06:22 AM(UTC)
DannyKao

Groups: Registered
Posts: 3


sorry, it did not work...

here are my test codes :

BITMAPHANDLE m_Bitmap;

unsigned char *raw = new unsigned char[44*56];

nRet = L_LoadBitmapMemory((L_CHAR*)raw, &m_Bitmap, sizeof(BITMAPHANDLE), 8, ORDER_GRAY, 44*56, NULL, NULL);

 

but i get nRet = -9, it means "invalid file format" !?

could you please tell me what happened?

 

 
#4 Posted : Monday, June 5, 2006 11:06:37 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

Are you sure that you have a valid image raw data inside the raw Buffer?
How exactly do you fill the raw Buffer?

Please provide me with the above information to continue investigating this issue.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Tuesday, June 6, 2006 12:49:22 AM(UTC)
DannyKao

Groups: Registered
Posts: 3


BITMAPHANDLE m_Bitmap;

unsigned char *raw = new unsigned char[44*56];

memset(raw, 0, 44*56);

nRet = L_LoadBitmapMemory((L_CHAR*)raw, &m_Bitmap, sizeof(BITMAPHANDLE), 8, ORDER_GRAY, 44*56, NULL, NULL);

 

the above 4 lines of codes are what i exactly tried.

i think it should be the raw data of a full black image.

but i still got the invalid file format error returned (-9).

 

 
#6 Posted : Thursday, June 8, 2006 3:16:16 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

Try to use the L_LoadMemory to load the file. You need to declare FILEREADCALLBACK pfnCallback function and pass it to the L_LoadMemory function.
However, please refer to the LEADTOOLS Main API demo and read the following topic:
- Working with the RAW File Filter

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.105 seconds.