WPF中怎么加载图片资源

new BitmapImage(new Uri("pack://application:,,,/**your assembly name**;component//Helper/Image/Image.png", UriKind.RelativeOrAbsolute));

Application.GetResourceStream(new Uri("/**your assembly name**;component/Helper/Image/Image2.png", UriKind.RelativeOrAbsolute))

 

https://docs.microsoft.com/en-us/dotnet/desktop/wpf/app-development/pack-uris-in-wpf?view=netframeworkdesktop-4.8

posted @ 2021-07-21 18:11  内心澎湃的水晶侠  阅读(618)  评论(0编辑  收藏  举报