WPF-后台使用资源图片

一般使用:

 Img.Image = new BitmapImage(new Uri("/Resources/列表循环_白.png", UriKind.Relative));

找不到时,使用:

 Img.ImageSource = new BitmapImage(new Uri("pack://application:,,,/MovieDesktop;component/Resources/列表循环_白.png", UriKind.Absolute));

注意把Resources中的资源图片设置为始终复制-资源;

posted @ 2022-01-15 18:42  ꧁执笔小白꧂  阅读(263)  评论(0编辑  收藏  举报