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

Unable to load web images

3 Answers 83 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Hans Notelteirs
Top achievements
Rank 1
Hans Notelteirs asked on 31 Jul 2009, 01:22 PM
Hi,

I'm having a problem loading images from the web inside my Coverflow.
I am using a Coverflow example that was posted in another thread named "CoverflowItemTemplate", because I need a description of my image. When I place the next code in my silverlight xaml file, the image is displayed correctly:

<Image Source="http://www.sterrennieuws.be/foto/1212315926.jpg" Width="280" Height="280" />

The ItemSource of my Coverflow I place in code like this:

var pictures = new List<PictureDetails>();
pictures.Add(new PictureDetails { Name = "CrossDomain", Image = new BitmapImage(new Uri("http://www.sterrennieuws.be/foto/1212315926.jpg", UriKind.Absolute)) }); 

for (int i = 1; i <= 21; i++)
{
       pictures.Add(new PictureDetails { Name = "Image" + i, Image = new BitmapImage(new Uri(string.Format("Images/nature{0}.png", i), UriKind.Relative)) });
}

coverFlow.ItemsSource = pictures;

The relative images are shown correctly, but the absolute one isn't loaded at all..
Is there anything I forgot to do?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 31 Jul 2009, 02:43 PM
Hi Hans,

Please, make sure you are running your application from a web application (or at least from a web server). If you run a Silverlight application locally (the address in the address bar is a local path) the application doesn't have access to the Internet because of security issues.

If you are not sure about this, please put a simple Image control with Source property set to the image that causes problems and check does it loads correctly. If it does not - this is the issue.

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Hans Notelteirs
Top achievements
Rank 1
answered on 03 Aug 2009, 06:14 AM
Hi,

As you could see in my previous post I have already tried that:

When I place the next code in my silverlight xaml file, the image is displayed correctly:
<Image Source="http://www.sterrennieuws.be/foto/1212315926.jpg" Width="280" Height="280" />

So the image is displayed when I use a simple Image control, but not when I use the Coverflow.
Another strange thing is, when I try out the project on my local machine it displays in the Coverflow.
But when I put the project on my virtual development machine, it doesn't work.

Now I did a few tests to get the Coverflow working, and it seems that the Image is displayed in the Coverflow if I also put that same image in an image control. So if I have http://www.test.com/1.jpg and http://www.test.com/2.jpg in the Coverflow and I put an Image Control on the page with source http://www.test.com/1.jpg, only this image is displayed in Coverflow. The other one is set as loading...

Thanks in advance
0
Miroslav Nedyalkov
Telerik team
answered on 06 Aug 2009, 02:29 PM
Hello Hans,

We will investigate the problem and try to figure out what causes it. Thank you for pointing us this issue. Your account is updated with Telerik points.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
CoverFlow
Asked by
Hans Notelteirs
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Hans Notelteirs
Top achievements
Rank 1
Share this question
or