June 15th, 2009, 04:55 AM
WPF Image list viewer problem
Im having trouble figuring out on how to implement my Image List viewer with the following specs;
- The image viewer loads more than 1000 files but must take less memory. It is given that each files is atleast 1mb each.
Therefore loading 1000 image alone already takes 1GB of memory.
My current implementaion simply loads all images to a Listbox binded to a List of images, and this list box is inside a scrollviewer (vertical scroll). This implementation obvoiusly is using more memory since it loads all images.
My plan is to load image only if visible in the scrollviewer, if not visible then image is dereference or not loaded at all.
DO you have any idea on how to implement this type of requirement?
Thanks in advance,
Last edited by cebugdev; June 15th, 2009 at 05:02 AM.
July 1st, 2009, 03:18 PM
Re: WPF Image list viewer problem
I'm not sure if a scrollviewer is the way to go or not... but in general you will want to look into WPF controls that provide virtualization features by default (ListBox and ListView). As you already stated, you will not want to pre-load all your images.
Check out Paul McClean's article on WPF virtualization:
WPF: Data Virtualization
I have found this helpful as well:
Click Here to Expand Forum to Full Width