1

i am setting image source from URL , but it does not show image properly , code which i use in windows phone 8 is below , thanks in advance ..

 image1.Source =  new BitmapImage(new Uri("http://d3sdoylwcs36el.cloudfront.net/VEN-virtual-enterprise-network-business-opportunities-small-fish_id799929_size485.jpg",UriKind.Absolute));

result is enter image description here

2
  • this code works for me Commented Jul 16, 2013 at 17:49
  • hmm good but did not work for me .. Commented Jul 16, 2013 at 18:02

1 Answer 1

2

i done it ,, call web service for image .. code is below ..

WebClient webClient = new WebClient();
webClient.OpenReadCompleted += ImageOpenReadCompleted;
webClient.OpenReadAsync(new Uri("http://d3sdoylwcs36el.cloudfront.net/VEN-virtual-enterprise-network-business-opportunities-small-fish_id799929_size485.jpg"));




private void ImageOpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
     if (!e.Cancelled && e.Error == null)
    {
        BitmapImage bmp = new BitmapImage();
        bmp.SetSource(e.Result);
        image1.Source = bmp;
    }
}

done it ... :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.