我使用相機捕獲照片並將其保存到本地,然後單擊返回到MainPage的後退按鈕,我希望捕獲的照片顯示在我的主頁面中。我用我的主網頁下面的代碼:WIndow 8應用程序自動從本地下載圖像
MainPage.xaml.cs中:
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
var parameter = e.Parameter as StorageFile;
if (parameter != null)
{
Uri uri = new Uri("CapturedImage.jpeg", UriKind.RelativeOrAbsolute);
finalImage.Source = new BitmapImage(uri);
}
}
錯誤消息是「型‘System.UriFormatException’的異常出現在System.dll中卻被沒有在用戶代碼中處理「。我該如何解決它?由於
'「CapturedImage。 jpeg「'不是一個有效的絕對URI。它至多是一個相對的。 – GSerg
我已經嘗試了「Relative」和「RelativeOrAbsolute」。但也不能。 –
捕獲後你在哪裏保存圖像? – Xyroid