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

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

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

XAML works:


<         


        
5条回答
  •  灰色年华
    2021-01-12 17:16

    It can be even easier than the above:

    ImageThing.Source = New BitmapImage(New Uri("images/Thing.png", UriKind.Relative))

提交回复
热议问题