ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Preload Images
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zerob

177 Posts

Posted - Nov 29 2024 :  10:26:56  Show Profile  Reply
Hi Nigel

Is it possible to force a ImageEnMView (with PDF's or Movie Frames) or a ImageEnFolderMView with files to preload?

Right now the ImageEnMView stutters after a PDF load while scrolling, until all Pages got into view and then it scrolls smooth.
LookAhead soesn't seem to solve this.

A PreloadAll or PreloadXPages(x) and / or a a complete decoupling of loading and scrolling (with placeholders) would be nice.

Having a stutterfest while scrolling a ImageEnMView with 15 pages (or sometimes much more), until all pages have been scrolled into view, isn't really nice.

xequte

38683 Posts

Posted - Dec 01 2024 :  00:36:52  Show Profile  Reply
Are you loading as follows: ImageEnMView1.MIO.LoadFromFile(...)?

What is your StoreType? To prevent loading on demand, you can use ietThumb.

http://www.imageen.com/help/TImageEnMView.StoreType.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zerob

177 Posts

Posted - Dec 01 2024 :  01:45:24  Show Profile  Reply
I connected a ImageEnMViewer to a ImageEnViewer and did load a PDF with either ImageEnView1.IO.LoadFromFilePDF or ImageEnView1.PdfViewer.LoadFromFile.

I tried without changing caching settings and then with:
ImageEnView1.PdfViewer.LoadOption := TPdfDocumentLoadOption.dloMemory;
ImageEnMView1.LookAhead := 50;
ImageEnMView1.EnableImageCaching := True;
ImageEnMView1.ImageCacheUseDisk := False;

And i set ietFastThumb, but changing it to ieThumb doesn't change anything. Even when i Load the PDF, wait 10-20 seconds and then scroll

When the PDF is loaded, i scroll the ImageEnMView and the scrollbar stutters until i scrolled down to the bottom and waited or if i don't stop scrolling, it stutters also on the way up (if i scroll up and down) and suddenly the stutter stopps and now all scrolling is smooth as butter.

It seems that ImageEnMView still loads the PDF pages only when they scroll into view and when it saw all pages, it runs smoothly.

I Imagined, when i wait for a few seconds, with LookAhead (or some magical preload function), then when i want to scroll, the ImageEnMView scrolls smoothly, without the need to scroll each Page into view (Inside of the ImageEnMView).
Go to Top of Page

xequte

38683 Posts

Posted - Dec 01 2024 :  19:43:40  Show Profile  Reply
Sorry, can you email me for the latest beta. In that configuration changing the StoreType will not improve the performance.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zerob

177 Posts

Posted - Dec 03 2024 :  16:49:59  Show Profile  Reply
I didn't notice any change in the beta. Do i need to do something to trigger the new changes?
Go to Top of Page

xequte

38683 Posts

Posted - Dec 03 2024 :  17:33:56  Show Profile  Reply
Hmmm, I'm not seeing that with ImageEnMView1.StoreType := ietFastThumb;

Is it a particularly complex document??

Can you try using our PDF Viewer demo (adding ImageEnMView1.StoreType := ietFastThumb):

\Demos\PDF\PDFViewer\PdfViewer.dpr


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zerob

177 Posts

Posted - Dec 04 2024 :  02:52:36  Show Profile  Reply
I get it in my app, no matter if i set it to ietThumb or ietFastThumb.
The only change i get with FastThumb is, that the Thumbs look really awful, as many things like lines and text looks too bold and too thick heavy black color.
Your PDFViewer demo still has the scroll lag.
The PDF im using is a random 37 page PDF i've downloaded from a customer.
I send you my demo together with the pdf in a demo, you can see both reported things (the stutter in the ImageEnMView on fast scroll, and the image placement at the cursor there.)
Go to Top of Page

xequte

38683 Posts

Posted - Dec 04 2024 :  21:37:12  Show Profile  Reply
Thanks for the demo.

I've made a logic change in the current beta.

With PDF TImageEnMView.StoreType will now operate in two different ways:
- ietFastThumb: PDF pages are loaded as they are displayed in the TImageEnMView
- ietThumb: All PDF pages are loaded at the outset into the TImageEnMView

e.g.

// Show thumbnail preview of all pages of a PDF document (loading pages as they are displayed)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnMView1.StoreType := ietFastThumb;
ImageEnMView1.AttachedImageEnView := ImageEnView1;
ImageEnMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );

// Show thumbnail preview of all pages of a PDF document (loading all pages immediately)
ImageEnView1.PdfViewer.Enabled := True;
ImageEnMView1.StoreType := ietThumb;
ImageEnMView1.AttachedImageEnView := ImageEnView1;
ImageEnMView1.MouseWheelParams.Action := iemwNavigate;      // Allow navigation by spinning the mouse wheel
ImageEnView1.IO.LoadFromFilePDF( 'C:\document.pdf' );



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zerob

177 Posts

Posted - Dec 05 2024 :  06:31:37  Show Profile  Reply
Thank you very much.
Maybe later a param to limit the preloading to a certain number of pages would be nice.
For example if you want to load the Thumbnails fast and some day a user loads a 2000 page document (or 300 or some other big number).
Then it would be nice to preload maximal X pages and do the rest on demand.
I don't know if the loading is multithreaded and uses up a very low RAM amount, or if it is blocking the whole UI while it loads x Gigabytes as Thumbnails.
Go to Top of Page

xequte

38683 Posts

Posted - Dec 05 2024 :  19:19:18  Show Profile  Reply
OK, we'll consider that for a future version.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: