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



Last Go to last post Unread Go to first unread post
#1 Posted : Friday, November 4, 2011 2:52:29 AM(UTC)


Groups: Registered
Posts: 10

L_LoadBitmapList can take some time for large image lists. Is there a way to set up a callback function that will be called for every page, so that I can display a progress bar.

I would also like to be able to cancel the operation, for example by returning a certain value from the callback.

I found a callback feature in LOADFILEOPTION, but it seems only meant for JPEG and CMP files. The FILEREADCALLBACK function is suitable for L_LoadFile but can't be used with image lists AFAIK.

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 : Tuesday, November 8, 2011 10:08:02 AM(UTC)


Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)


As you've noted, the L_LoadBitmapList method doesn't have a callback. I've also checked this, and I noted that L_LoadBitmap doesn't provide a callback either.

As I see it, there's two ways that you can implement this. You could use L_LoadBitmap, and specify a single page to load at a time. By doing so, you can create your own loop. Since you'll know how many pages you're loading at one time, you could update your progress bar by setting it's value to be (number of pages loaded/total pages) * 100. You can set which page to load using a copy of LOADFILEOPTION with LOADFILEOPTION.PageNumber

Using L_LoadFile, you can use the FILEREADCALLBACK to get each individual page, and you can pass the total number of pages in the user data (if necessary). Similiarly with L_LoadBitmap, you can use your own count to update a progress bar.

Whichever method you use, you can create your own list with L_CreateBitmapList, and then add each BITMAPHANDLE using L_InsertBitmapListItem.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
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-2023, Yet Another Forum.NET
This page was generated in 0.056 seconds.