在Windows Phone 8.1中显示来自网站的图像

时间:2015-03-06 00:26:46

标签: windows-phone-8 windows-runtime

为什么该代码在WinRT中工作但在Windows Phone 8.1中不起作用?

foreach (var img_url in imagesList)
        {
            image = new Image();
            image.Source = new BitmapImage(new Uri(img_url, UriKind.Absolute));
            image.Width = 300;
            image.Height = 300;
            pnlImages.Children.Add(image);
        }

1 个答案:

答案 0 :(得分:0)


试试这个:

foreach (var img_url in imagesList)
            {
                image = new Image();
                image.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(img_url));
                image.Width = 300;
                image.Height = 300;
                pnlImages.Children.Add(image);
            }

希望它有所帮助!