[英]Image WPF not showing at runtime, after moved MainWindow.xaml
在我的應用程序中,我已移動
MainWindow.xaml
MainWindow.xaml.cs
到我項目中的文件夾app
(當然我在我的App.xaml
StartupUri="app/MainWindow.xaml"
已更改)。
之后,我的圖像在運行時不顯示圖片。:
<Image Source="asd.jpg" HorizontalAlignment="Left" Height="170" Width="201"/>
您還應該將圖像Source="/WpfApplication;component/asd.jpg"
更改為Source="/WpfApplication;component/asd.jpg"
:
<Image Source="/WpfApplication;component/asd.jpg" HorizontalAlignment="Left"
Height="170" Width="201"/>
WpfApplication
是您的應用程序的名稱。
要么
來源=“ ../ asd.jpg”
因為您現在需要在文件夾中上一層以獲取圖像
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.