Reputation: 15
I have been working on a WP8 app, it's image gallery app,,Here I have been using pivot control &list box to collect Camera Roll images(dynamically) from the device and swipe one by one,it is working fine But I found app's memory consumption is raising and How to resolve this?
I am trying to figure out how to code a program where I have an list of images, where only one image is shown at a time, but the adjacent images are preloaded but not visible. After each flick, the now current image animates itself over to the visible area, and the adjacent images are updated, but not visible until the next flick in either direction. I only want to have 3 'boxes'(cycle),consisting of the image to the left, current image on screen, and the image to the right. If revolving to the right, the current image becomes the left image, the image to the right becomes the current image, and the next image is preloaded but not visible.
Example:
First image you see is when the app is loaded. It's essentially the first image in the List box .Call it (Image 1).
You cannot flick to the left, as no image is there. But the image to the right of it (not visible yet) is already preloaded and ready to slide when the flick is registered. (image 2)
So if we flick to the right, Image 1 is to the left of the now visible and centered Image 2. Image 3 is now to the right, not visible but preloaded. Image 1 is now to the left, not visible but preloaded.
**I only want to have 2 things preloaded now, so you can imagine 3 slots. One slot is the left picture. One slot is the current view, and one slot on the right.
The idea is to be able to have a carousel of images, but only preloading the images to the left and right of the current view.
Upvotes: 0
Views: 266
Reputation: 122
You have to either de-allocate the memory consumed by outgoing image or re-use it to load the incoming image.
Can you be a little more clear exactly what you have done and where you are facing a difficulty?
Upvotes: 0
Reputation: 6142
Check out the Lens example on MSDN here : http://code.msdn.microsoft.com/wpapps/Basic-Lens-sample-359fda1b it has a MediaViewer class that handles images as a image carousel and does virtualization.
Upvotes: 1