码迷,mamicode.com
首页 > Web开发 > 详细

silverlight imagesource赋值与转换

时间:2015-02-01 00:29:42      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:

介绍几种常用的Image source 赋值方式:

this.abc.Source = new BitmapImage(new Uri("/1.jpg", UriKind.RelativeOrAbsolute));
Uri uri = new Uri("1.jpg", UriKind.Relative);
ImageSource imgSource = new System.Windows.Media.Imaging.BitmapImage(uri);   
this.abc.SetValue(Image.SourceProperty, imgSource);
this.abc.Source = new BitmapImage(new Uri("F:\\1.jpg", UriKind.RelativeOrAbsolute));

/{程序集名};component搜索/{图片资源路径}

 var uri = new Uri("/AppleMenu;component/Res/" + value + ".png", UriKind.Relative);
                IconImage.Source = new System.Windows.Media.Imaging.BitmapImage(uri);

 

silverlight imagesource赋值与转换

标签:

原文地址:http://www.cnblogs.com/lsqandzy/p/4264900.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!