Vaysage
Vaysage

Reputation: 1356

How to display Images from internet in a windows phone 7 app?

I am making an application which gets urls of images by parsing an RSS feed.I want to diplay that images in the application one after another when tapped on screen .How can i do it? Is it required to download all images before displaying? Please explain.

Thanks and regards

vaysage

Upvotes: 1

Views: 8129

Answers (3)

thomasmartinsen
thomasmartinsen

Reputation: 1993

Maybe I don't understand your question correctly but you should be able to set the Source of an Image element directly to an URI specified in your RSS feed item.

<Image x:Name="m_Image" Source="http://www.microsoft.com/silverlight/images/ms-silverlight-logo.png"/>

When changing item (by tapping) you can easily swap the source of the image from your code.

Uri uri = new Uri("...", UriKind.Absolute);
ImageSource imgSource = new BitmapImage(uri);
m_Image.Source = imgSource;

Using LowProfileImageLoader (as mentioned by Thomas Joulin and Mick N) is a good way to load images in the background and keep the UI responsive.

Upvotes: 8

Thomas Joulin
Thomas Joulin

Reputation: 6650

  • Parse you're RSS Feed to get the images URL's (using for exemple HTTPWebRequest)
  • Set the binding for the source of each of you images (since it's web based, I recommend LowProfileImageLoader which will load images in the background.
  • Create a SlideShow.xaml view, based on a pivot. Dynamically add Pivot items
  • On tap on a thumbnail, launch the SlideShow.xaml, at the specified index

Upvotes: 4

Related Questions