Synchronously download an image from URL

后端 未结 4 2024
离开以前
离开以前 2020-12-24 10:18

I just want to get a BitmapImage from a internet URL, but my function doesn\'t seem to work properly, it only return me a small part of the image. I know WebResponse is work

4条回答
  •  离开以前
    2020-12-24 10:39

    The simpliest is

    Uri pictureUri = new Uri(pictureUrl);
    BitmapImage image = new BitmapImage(pictureUri);
    

    you can then change BitmapCacheOption to start the retrieval process. However, image is retrieved in async. But you shouldn't care much

提交回复
热议问题