编码设置 Image.Source
时间:2011-05-13 来源:lzhm
     
  很多时候,需要编码动态设置显示图片,方法上不是那么直接,从网上找到合适的方法,这里做一下记录。
  需要引用的命名空间
  System.Windows.Media.Imageing;
  代码:
  Uri uri = new Uri("image/aaa.png",UriKind.RelativeOrAbsolute);
  ImageSource imgSource = new BitmapImage(uri);
  img.Source = imgSource;
  搞定。
  
   相关阅读 更多 + 
    
  









