WPF BitmapImage 從資源檔案中使用Uri加載圖檔
1、圖檔生成操作設定為Resource
2、設定Uri
Uri uri = new Uri(“pack://application:, , ,/UriDemo.Demo;component/common/Images/” + name + “.png”)
3、顯示圖檔
BitmapImage image = new BitmapImage(new Uri(“pack://application:,/UriDemo.Demo;component/common/Images/” + name + “.png”));