WPF: “Value of type 'String' cannot be converted to 'System.Windows.Media.ImageSource'.”

后端 未结 5 1917
没有蜡笔的小新
没有蜡笔的小新 2021-01-12 16:42

I\'m trying to set a WPF Image\'s source.

XAML works:


<         


        
5条回答
  •  臣服心动
    2021-01-12 17:36

    you will probably need to do something like this

    Uri i = new Uri("images\\Thing.png");
    

    keep in mind that you need to use a \ not a / for a windows file system

    Take a look here

提交回复
热议问题