Unable to load web images

4 posts, 0 answers
  1. Hans Notelteirs
    Hans Notelteirs avatar
    19 posts
    Member since:
    Apr 2009

    Posted 31 Jul 2009 Link to this post

    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
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 31 Jul 2009 Link to this post

    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.
  3. DevCraft banner
  4. Hans Notelteirs
    Hans Notelteirs avatar
    19 posts
    Member since:
    Apr 2009

    Posted 03 Aug 2009 Link to this post

    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
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 06 Aug 2009 Link to this post

    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.
Back to Top