AVIK DUTTA
AVIK DUTTA

Reputation: 736

How to save a bitmapimge from url to an object of bitmap in wp8.1?

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

Answers (1)

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

Related Questions