首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Windows Mobile >

在wp7中怎么给image赋值

2012-05-02 
在wp7中如何给image赋值在wp7中如何给image的source属性赋图片路径值[解决办法]前台直接写上路径即可,不过

在wp7中如何给image赋值
在wp7中如何给image的source属性赋图片路径值

[解决办法]
前台直接写上路径即可,不过要把图片的Build Action设置成Content,
Copy to output directory设置成Copy always
后台需要使用BitmapImage
BitmapImage bitmapImage=new BitmapImage();
bitmapImage.UriSource=new Uri("1.png",UriKing.Relative);
img.Source=bitmapImage;
如果图片的Build Action为Resources,则路径应写成
/Project;componment/img.png
[解决办法]

探讨

前台直接写上路径即可,不过要把图片的Build Action设置成Content,
Copy to output directory设置成Copy always
后台需要使用BitmapImage
BitmapImage bitmapImage=new BitmapImage();
bitmapImage.UriSource=new Uri("1.png",UriKing.Relati……

[解决办法]
http://www.cnblogs.com/chenping-987123/archive/2011/04/22/2024818.html


http://www.cnblogs.com/chenping-987123/archive/2011/09/29/2195777.html
[解决办法]
在xaml中 设置 source="地址" 如果是本地图片的话 要把图片的属性 Build Action设置为content,这样就行了

热点排行