Image source 赋值问题

http://bbs.csdn.net/topics/390120529

最后通过这种方式实现 
 string url = carInfo.NetworkPath + carInfo.FileSource.First;
 // url:http://localhost/ITSImages/20120625/01/192168010176/卡口抓拍/皖J21742.jpg
                Uri uri = new Uri(url);
                WebClient w = new WebClient();
                w.OpenReadCompleted += (sender, e) =>
               {
                   if (e.Error == null)
                   {
                       BitmapImage bitImg = new BitmapImage();
                       bitImg.SetSource(e.Result);                       this.SSCX.pic.Source = bitImg;
                 
                   }
                   // else 
                   // this.SSCX.pic.Source ="本地图片";
               };
                w.OpenReadAsync(uri);


posted @ 2015-02-05 10:25  西楼月光  阅读(361)  评论(0编辑  收藏  举报