Windows phone 7 需要帮助修复异常吗
有人能解释以下两种崩溃异常吗!我无法理解如何修复它们- 帧图像功能偏移量Windows phone 7 需要帮助修复异常吗,windows-phone-7,exception,app-hub,Windows Phone 7,Exception,App Hub,有人能解释以下两种崩溃异常吗!我无法理解如何修复它们- 帧图像功能偏移量 0 coredll.dll xxx_RaiseException 19 1 mscoree3_7.dll 436488 2 mscoree3_7.dll 386545 3 mscoree3_7.dll 540936 4转换桶0 5 MS.Internal.XcpImports.CheckHResult 100 6 MS.Internal.XcpImports.MessageBox_ShowCore 112 7 System
0 coredll.dll xxx_RaiseException 19
1 mscoree3_7.dll 436488
2 mscoree3_7.dll 386545
3 mscoree3_7.dll 540936
4转换桶0
5 MS.Internal.XcpImports.CheckHResult 100
6 MS.Internal.XcpImports.MessageBox_ShowCore 112
7 System.Windows.MessageBox.ShowCore 272
8 PhotoRotator.TransformedImage.SaveButton_单击504
9 Microsoft.Phone.Shell.ApplicationBarItemContainer.FireEventHandler 292
10 Microsoft.Phone.Shell.ApplicationBarIconButton.ClickEvent 88
11 Microsoft.Phone.Shell.ApplicationBarIconButtonContainer.ClickEvent 60
12 Microsoft.Phone.Shell.ApplicationBar.OnCommand 160
13 Microsoft.Phone.Shell.Interop.NativeCallbackInteropRapper.OnCommand 72
14 mscoree3_7.dll 429164
15 mscoree3_7.dll 430528
16 mscoree3_7.dll 610803
17 mscoree3_7.dll 393257
18 0
19 corex.dll ApplicationBarInterop::ApplicationBarCallback::OnCommand 15 具体代码如下所示-
private void SaveButton_Click(object sender, EventArgs e)
{
WriteableBitmap wb = new WriteableBitmap(SelectedImage.TransformedImage);
MemoryStream targetStream = new MemoryStream();
wb.SaveJpeg(targetStream, wb.PixelWidth, wb.PixelHeight, 0, 100);
if (targetStream != null)
{
targetStream.Seek(0, 0); // necessary to initiate the stream correctly before save
try
{
MediaLibrary ml = new MediaLibrary();
Picture p = ml.SavePicture(Guid.NewGuid().ToString(), targetStream);
MessageBox.Show("Saved Successfully to your Media Library!");
}
catch (Exception ex)
{
MessageBox.Show("Error - " + ex.Message);
}
}
else
{
MessageBox.Show("Unexpected error!");
}
}
第二个->
帧图像功能偏移量0 coredll.dll xxx_RaiseException 19
1 mscoree3_7.dll 436488
2 mscoree3_7.dll 386545
3 mscoree3_7.dll 540936
4转换桶0
5 Microsoft.Xna.Framework.Helpers.throweExceptionfromErrorCode 80
6 Microsoft.Xna.Framework.Media.MediaLibrary.GetPictureFromToken 280
7 PhotoRotator.MainPage.on导航到216
8 Microsoft.Phone.Controls.PhoneApplicationPage.InternalOnNavigatedTo 288
9 System.Windows.Navigation.NavigationService.RaiseNavigated 488
10 System.Windows.Navigation.NavigationService.CompleteNavigation 812
11 System.Windows.Navigation.NavigationService.ContentLoader\u BeginLoad\u回调968
12 System.Windows.Navigation.PageResourceContentLoader.BeginLoad\u OniThread 1108
13.\u c\u显示类别4.\u开始加载\u b\u 0 64
14 mscoree3_7.dll 429164
15 mscoree3_7.dll 185803
16 mscoree3_7.dll 184423
17 System.Reflection.RuntimeMethodInfo.InternalInvoke 112
18 System.Reflection.RuntimeMethodInfo.InternalInvoke 1560
19 System.Reflection.MethodBase.Invoke 104 这段代码是->
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (e.NavigationMode == NavigationMode.New)
{
// Get a dictionary of query string keys and values.
IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;
// Ensure that there is at least one key in the query string, and check whether the "token" key is present.
if (queryStrings.ContainsKey("token"))
{
// Retrieve the picture from the media library using the token passed to the application.
MediaLibrary library = new MediaLibrary();
Picture picture = library.GetPictureFromToken(queryStrings["token"]);
// Create a WriteableBitmap object and add it to the Image control Source property.
BitmapImage bitmap = new BitmapImage();
bitmap.CreateOptions = BitmapCreateOptions.None;
bitmap.SetSource(picture.GetImage());
//WriteableBitmap picLibraryImage = new WriteableBitmap(bitmap);
//retrievePic.Source = picLibraryImage;
SelectedImage.OriginalImage = bitmap;
navigateCompleted(null, null);
//NavigationService.Navigate(HelperClass.Constants.TransformPageUri);
//NavigationService.Navigated -= new NavigatedEventHandler(navigateCompleted);
}
}
受保护的覆盖无效OnNavigatedTo(NavigationEventArgs e)
{
基地。导航到(e);
if(e.NavigationMode==NavigationMode.New)
{
//获取查询字符串键和值的字典。
IDictionary QueryString=this.NavigationContext.QueryString;
//确保查询字符串中至少有一个键,并检查“令牌”键是否存在。
if(queryStrings.ContainsKey(“令牌”))
{
//使用传递给应用程序的令牌从媒体库检索图片。
MediaLibrary=新的MediaLibrary();
Picture Picture=library.GetPictureFromToken(queryString[“token”]);
//创建WriteableBitmap对象并将其添加到图像控件源属性。
BitmapImage位图=新的BitmapImage();
bitmap.CreateOptions=BitmapCreateOptions.None;
位图
8 PhotoRotator.TransformedImage.SaveButton_Click 504