Loading thumbnails in ThumbnailEx control

Discussions about document viewing.
Post Reply
bentigano
Posts: 5
Joined: Tue Aug 14, 2012 2:55 pm
Location: Boston, MA

Loading thumbnails in ThumbnailEx control

Post by bentigano » Thu Oct 11, 2012 8:36 pm

We're currently using GdPicture v9 - mainly the PDF portion of the library. In one of our applications, we have a ThumbnailEx control that loads its data from a GdViewer.

The question I have is regarding the PreloadAllItems property of the ThumbnailEx control. If I set that to False, then my 100-page PDF document comes up instantly, and all of the thumbnails that are visible without scrolling are shown. The issue is that none of the other thumbnails are fetched until you physically scroll down in the ThumbnailEx control. So if I load a document, wait 30 minutes, and then scroll to the last pages in the ThumbnailEx control, it still pauses to load those thumbnails.

Conversely, if I set PreloadAllItems to true, it takes about 12 seconds to load, but as soon as it comes up, I can scroll all the way to the bottom of the ThumbnailEx control and all the thumbnails are there without any waiting.

What we're looking for is a hybrid of both behaviors. We don't want to have to wait until all 100 pages are loaded before showing the document, but the thumbnails would get generated without the user needing to scroll through everything. Obviously if the user opens the document and scrolls straight to the bottom they're going to have to wait, but it would be much more efficient than waiting for the user to scroll to a point to start loading the thumbnails for that point.

Can you explain if that's possible by using the functionality that already exists? Or is that something that you'd need to add in a future version?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Loading thumbnails in ThumbnailEx control

Post by Loïc » Fri Oct 12, 2012 11:53 am

Hello,
hat we're looking for is a hybrid of both behaviors. We don't want to have to wait until all 100 pages are loaded before showing the document, but the thumbnails would get generated without the user needing to scroll through everything.
I am probably not understanding what you need because what you've described is the actual behavior when the preloadAllitems property is set to true.

Kind regards,

Loïc

bentigano
Posts: 5
Joined: Tue Aug 14, 2012 2:55 pm
Location: Boston, MA

Re: Loading thumbnails in ThumbnailEx control

Post by bentigano » Fri Oct 12, 2012 2:21 pm

Actually, after some further investigating, you're right.

It has something to do with how I'm opening the document. The tool we've created is a PDF manipulation tool (dragging and drogging pages between different docs, rotating, re-ordering, etc.) and we have a few different ways of opening the document.

I'll keep working on it and report back in case somebody is trying to do the same thing, but it doesn't appear to be an issue with the GdPicture library.

Thanks for all your help and speedy response, Loic!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Loading thumbnails in ThumbnailEx control

Post by Loïc » Fri Oct 12, 2012 3:23 pm

you're welcome ;)

bentigano
Posts: 5
Joined: Tue Aug 14, 2012 2:55 pm
Location: Boston, MA

Re: Loading thumbnails in ThumbnailEx control

Post by bentigano » Fri Oct 12, 2012 4:13 pm

The issue had to do with the order in which I was processing the command-line args of documents to open and when the application actually starts (Application.Run.)

In the Main method of my application, I was calling methods on the main form that would actually open the documents (even before I called Application.Run.) I changed it so that I push those command-line args into a property on the main form, and then handle them in the Load method of the form (after Application.Run.) which seems to have solved the problem 100%.

It seemed almost as if the process that generates the thumbnails was using the same thread as the application, which is what caused it to hang up while those thumbnails were loading.

Either way, we're all good now.

Hope this helps, and thanks again!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest