2016-06-11 20 views
0

我已經創建在Visual Studio 2k15 WPF C#項目,我已經放置在X目錄下2個文件,所以我的DIR樣子:C#WPF - 錯了目錄的圖像,但視頻作品確定

app.exe 
X->1.mp4,2.png 

當我正在選擇用於MediaElement的(視頻)目錄,它工作正常

<MediaElement x:Name="backgroundvideo" Source="X\1.mp4" IsMuted="True"/> 

但是當我選擇DIR我imageelement(圖片),它說:

Could not find file (path to vs main folder) 

我的imageelement看起來是這樣的:

<Image x:Name="login_ico_png" Source="x/2.png" Margin="120,50,120,422" 
          Stretch="Fill" Width="128" Height="128"/> 

回答

0

嘗試:

<Image x:Name="login_ico_png" Source="ms-appx:///x/2.png" Margin="120,50,120,422" 
          Stretch="Fill" Width="128" Height="128"/>