This is a migrated thread and some comments may be shown as answers.

Image Editor Application_UnhandledException

2 Answers 40 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joaquim
Top achievements
Rank 1
Joaquim asked on 14 Jun 2014, 06:41 PM
Hi,

I am trying to build a Image Editor for Windows Phone 8 app but every time  I save an image I always get a system Application_UnhandledException like bellow;

+ $exception {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at Microsoft.Xna.Framework.Media.MediaLibrary.SavePicture(String name, Stream source)
   at Telerik.Windows.Controls.RadImageEditor.SaveJpg(WriteableBitmap image, String fileName, Int32 quality)
   at Telerik.Windows.Controls.RadImageEditor.SaveToPhoneLibrary(String fileName, Int32 quality)
   at Telerik.Windows.Controls.RadImageEditor.<OnApplyClick>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
   --- End of inner exception stack trace --- 
...

Please find my project here...

I'll be very grateful if someone could help me.
Thanks in advance
Joaquim





2 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 18 Jun 2014, 03:07 PM
Hi Joaquim,

Windows Phone 8 apps need to specify the ID_CAP_MEDIALIB_PHOTO capability to access photos in the media library. After adding it to the WMAppManifest.xml it started working as expected.

As a side note, I have edited your post to remove the link to the project, as it contains dev assemblies, which are not publicly available. In case you need to attach a project, you can open a formal support ticket. This way you will be able to add private attachments.

Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Joaquim
Top achievements
Rank 1
answered on 18 Jun 2014, 05:05 PM
Thank you for the tip. Its working fine now.

Best Regards
Tags
ImageEditor
Asked by
Joaquim
Top achievements
Rank 1
Answers by
Ves
Telerik team
Joaquim
Top achievements
Rank 1
Share this question
or