直接上代码
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.UriSource = new Uri(weatherImageForTopImage.BaseUri, (e.ClickedItem as MyTripItemTemplate).weatherImage);
weatherImageForTopImage.Source = bitmapImage; //weatherimage就是我要显示的image控件名字
本文介绍了一种在WPF应用程序中使用BitmapImage类来加载并显示天气图片的方法。通过设置BitmapImage的UriSource属性为特定天气图片的路径,可以将图片作为图像源绑定到名为weatherimage的控件上。
直接上代码
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.UriSource = new Uri(weatherImageForTopImage.BaseUri, (e.ClickedItem as MyTripItemTemplate).weatherImage);
weatherImageForTopImage.Source = bitmapImage; //weatherimage就是我要显示的image控件名字
3310

被折叠的 条评论
为什么被折叠?