Reputation: 736
I want to save am image from [URL : https://www.example.com/folders/file.jpg][1]
in an object of BitmapImage
I tried the following :
BitmapImage b = new BitmapImage();
b.SetSource(new Uri("https:www.example.com/folders/file.jpg", UriKind.RelativeOrAbsolute));
But its not working. Why?
Upvotes: 0
Views: 130
Reputation: 2657
This code test and work for me: Image MyImage = new Image();
// Create source.
BitmapImage bImage = new BitmapImage();
bImage.UriSource = new Uri(@"https:www.example.com/folders/file.jpg", UriKind.RelativeOrAbsolute);
// Set the image source.
MyImage.Source = bImage;
Tell me if work for you or need more info. Good luck man!
Upvotes: 1