views:

403

answers:

2

I wanted to make the listview show thumbnails only when the items are visible on the screen. Is there a way to do this?

+3  A: 

See an excellent implementation of what your after on CodeProject

Thushan Fernando
that link on codeproject was an overkill, It is fine with me to have a slow generation of thumb my concern is only to find a way to thumb only the items that i'm currently viewing like how vista explorer do which only thumbs the item that currently is visible. But anyway thanks for the link i'll try to study the source code for now.
murasaki5
+4  A: 

You can do this by using a ListView in virtual mode, and then adding your generated thumbnails to the LargeImageList during the RetrieveVirtualItem event (if they are not already there).

If you wanted most of the work done for you, you could use a FastObjectListView from the ObjectListView project (an open source wrapper around .NET WinForms ListView) and then follow this recipe on how to use images loaded from a database. Your images, of course, would be thumbnails created from the source rather than images from a database but the logic is the same.

Grammarian
thanks this one works.
murasaki5