2012-06-30 2 views
0

누군가 다음과 같은 2 가지 예외 상황을 설명 할 수 있습니까? 나는 그 문제를 해결 할 방법을 이해 드릴 수 없습니다 -예외 수정을위한 도움이 필요합니다.

프레임 이미지 기능 오프셋
0 coredll.dll의 xxx_RaiseException 19
1 mscoree3_7.dll 436488
2 mscoree3_7.dll 386545
3 mscoree3_7.dll 540936
4 TransitionStub 0
5 MS.Internal.XcpImports.CheckHResult 100
6 MS.Internal.XcpImports.MessageBox_ShowCore 112,453,210 7 System.Windows.MessageBox.ShowCore 272
8 PhotoRotator.TransformedImage.SaveButton_Click 504
9 Microsoft.Phone.Shell.ApplicationBarItemContainer.FireEventHandler 292
Microsoft.Phone.Shell.ApplicationBarIconButton.ClickEvent 10 88 11 마이크로 소프트
.Phone.Shell.ApplicationBarIconButtonContainer.ClickEvent 60
12 Microsoft.Phone.Shell.ApplicationBar.OnCommand 160
13 Microsoft.Phone.Shell.Interop.NativeCallbackInteropWrapper.OnCommand 72
14 mscoree3_7.dll 429,164
15 mscoree3_7.dll 430,528
16 mscoree3_7.dll 610,803
17 mscoree3_7.dll 393,257이
18 0 19
corex.dll 코드의 특정 조각이 ApplicationBarCallback :: 15 :: 요구시 작동

이다 ApplicationBarInterop 아래와 같이 발표 -

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!"); 
      } 
     } 

2 일 ->

프레임 이미지 오프셋 기능
0 coredll.dll의 xxx_RaiseException 19
1 mscoree3_7.dll 436,488
2 mscoree3_7.dll 386,545
3 mscoree3_7.dll 540,936
4 TransitionStub 0
5 Microsoft.Xna.Framework. Helpers.ThrowExceptionFromErrorCode 80
6 Microsoft.Xna.Framework.Media.MediaLibrary.GetPictureFromToken 280
7 PhotoRotator.MainPage.OnNavigatedTo 216
8 Microsoft.Phone.Controls.PhoneApplicationPage.InternalOnNavigatedTo 288

488 10 812 System.Windows.Navigation.NavigationService.CompleteNavigation
11 시스템 System.Windows.Navigation.NavigationService.RaiseNavigated .Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback 968
12 System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread 1,108
13 ._ C _DisplayClass4._BeginLoad_b__0 64
14 mscoree3_7.dll 429,164
15 mscoree3_7.dll 185,803
16 mscoree3_7.dll 184,423
17 System.Reflection.RuntimeMethodInfo.InternalInvoke 112
18 시스템 .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); 
       } 
      } 
+1

코드를 생성하면 좋은 시작이 될 것입니다. – ctacke

+0

참조 용 코드를 추가했습니다. 감사! – whihathac

답변

0

저장 버튼의 클릭 이벤트에 오류가 같은 몇 가지 코드를 추가 할 수 있지만 첫 번째 예외는 보이는하십시오

8 PhotoRotator.TransformedImage.SaveButton_Click 504 

시도가 단계별로 디버깅 할 수 있습니다. 몇 가지 코드를 알려주십시오.

+0

나는 debiugging을 끝냈습니다. 그러나 그것은 특별한 상태에서 실패했을 것 같습니다. 참조 용 코드를 추가했습니다. – whihathac