This is a migrated thread and some comments may be shown as answers.

Large number of big images

2 Answers 64 Views
SlideView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin
Top achievements
Rank 1
Martin asked on 09 Feb 2012, 09:12 PM
Hello,

I try to display a large number (about 100) of big images (each about 1MB). The images are stored in the IsolatedStorage of the Device. If I added them direct to the project and add a list of Uris, the control works perfect.

But If I try to get the images from the storage I have some problems. If I use a BitmapImage Array as DataSource, where the files created out of an IsolatedStorageFileStream, I get of course an OutOfMemoryException.

If I try to use an LoopingListDataSource no images are displayed. My code looks like this:
var source = new LoopingListDataSource(numberOfImages);
source.ItemNeeded += ((sender, e) =>
{
    e.Item = new PictureDataItem();
});
 
source.ItemUpdated += ((sender, e) =>
{
    var bitmap = new BitmapImage();
    using(var stream = Storage.GetFileStream(String.Format("{0}.jpg", (e.Index+1))))
    {
        bitmap.SetSource(stream);
    }
 
    var picture = e.Item as PictureDataItem;
    if (picture == null)
        return;
 
    picture.Source = bitmap;
});
_slideView.DataSource = source;

Which options does I have to realize my scenario?

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Martin
Top achievements
Rank 1
answered on 10 Feb 2012, 09:56 AM
Hello,

I solve my problem. I need to define an own ItemTemplate

<telerikPrimitives:RadSlideView x:Name="_imageView" AllowZoomOut="False">
    <telerikPrimitives:RadSlideView.ItemTemplate>
        <DataTemplate>
            <slideView:PanAndZoomImage Source="{Binding Source}" />
        </DataTemplate>
    </telerikPrimitives:RadSlideView.ItemTemplate>
</telerikPrimitives:RadSlideView>
0
Deyan
Telerik team
answered on 10 Feb 2012, 10:06 AM
Hello Martin,

It's good that you've managed to resolve your case by yourself.

We will consider this thread closed for now.

Do not hesitate to get back to us in case you have further questions or need assistance.

Regards,
Deyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
SlideView
Asked by
Martin
Top achievements
Rank 1
Answers by
Martin
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or