后台数据绑定
//本地
this.image1.Source = new BitmapImage(
new Uri("Desert.jpg", UriKind.Relative)
);
//网络
this.image1.Source = new BitmapImage(
new Uri("http://img.download.pchome.net/3k/37/131467_800x600.jpg", UriKind.Absolute)
);

本文介绍了如何在WPF应用程序中加载本地和网络图片的方法。通过使用BitmapImage结合Uri进行资源定位,实现了从不同来源加载图片的功能。
756

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



