From: Simon [2610] on
On 22 Jun., 06:50, Tim Roberts <t...(a)probo.com> wrote:
> "Simon [2610]" <djur...(a)gmail.com> wrote:
>
> >Im building an application to use instead of the explorer thumbnail
> >view.
> >Lets say i have a folder with 2500 images, and at any given time i can
> >show 25 images at thumbnail size on my screen. I have a control
> >(PictureControl, PC) on which i have a picturebox to display the
> >individual images, and a label for the name.
> >Ive loaded all theese 2500 controls onto a FlowLayoutPanel.
> >Now i want an event to fire when i scroll and a PC becomes visible, so
> >that i can load the image then, and when it leaves the visible area i
> >can unload the image. so that i use a minimal amount of memory.
>
> That's a false optimization.  2500 thumbnails at 64x64 true color totals
> only 30 megabytes of memory.  Absolutely trivial.

i didnt think of actually converting to thumbnail size and using those
images, just loading the original ones ( which often will be 5mb+)..
but that may be a good idea. my thumbnails are a little larger
(120x120) but still even with 10000 images it should be a manageable
amount of memory.

> >I thought the visiblechanged event was what i needed, but they are
> >always visible :/
>
> Really, the whole point of a FlowLayoutPanel is that you don't have to
> worry about when controls come and go.  You might consider using a
> different kind of container, where you can intercept the scroll operations
> and update the images manually.
>
> >I am building this because im getting tired of waiting for windows to
> >finish producing the thumbnails when i view a folder, and have found
> >no way to force windows to load all the thumbnails without me
> >scrolling down and looking at them (and even then it can seem like its
> >stalling).
>
> Well, you only pay that penalty the first time, until it builds the
> thumbnail database.  Are you sure you can build the thumbnails faster?  It
> takes time to read a large image file.

i did a thumbnail generator a few months back, which went really fast
with 8 threads. The largest problem with the windows thumbnail view is
when it stalls and i have to wait for 30 seconds for it to pick up
again, i can avoid this in my own program cause ill decide for it what
to do :)

Thanks for your time!

best regards
Simon

From: Tim Roberts on
"Simon [2610]" <djurhus(a)gmail.com> wrote:
>
>i didnt think of actually converting to thumbnail size and using those
>images, just loading the original ones ( which often will be 5mb+)..

2500 images at 5MB is 12GB. No matter how many threads you use, it takes a
full minute or more just to read that much data from disk...
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.