Silverlight Annotation Fun

Well it looks like somebody's been playing with my Silverlight Annotation sample that I put on my website . This is the application that is described in my MSDN article, Write On! Create Web Apps You Can Draw On with Silverlight 2. I just realized that the code download does not seem to be on the magazine website. I'm not sure why. The download is not just the samples displayed in the article but the complete application. I'll update this blog post when that gets corrected.

In the mean time I enjoyed seeing some of the clever annotations that have been drawn on the photos in my sample application. The drawings are stored in a database and called up when the image is selected from the listbox on the right. Each new annotation saved will overwrite the last so these beauties will eventually get lost and I wanted to save them.

annofuna

annofunb

annofunc

annofund

#1 David on 8.26.2008 at 8:22 AM

That's a very nice job. I like it so much. Thanks!

#2 tluyet on 9.18.2008 at 10:07 AM

Is there anyway you could send me or put up a link for the download of the source code to this program? I am really only interested in the saveing of the annotation and the restoration of annotation saved. However this program has all of that and more and would be very helpful to me.

#3 Julia Lerman on 9.18.2008 at 10:17 AM

I uploaded it a week or so ago. www.thedatafarm.com/.../MSDNMagSilverli

#4 tluyet on 9.18.2008 at 10:30 AM

Sorry I didn't see that post.Thanks a million thought this is exactly what I needed.

#5 Grant on 6.25.2009 at 11:45 PM

Hi,I'm trying your silverlight demo for drawing and saving as img, but it comes error then run in vs2008 sp1,

Microsoft JScript runtime error: Sys.InvalidOperationException: ManagedRuntimeError error #4004 in control 'Xaml1': System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.ServiceModel.CommunicationException: An error occurred while trying to make a request to URI 'http://localhost:55242/SilverlightInkService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error.

at System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

at System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)

at System.Net.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)

--- End of inner exception stack trace ---

at System.Net.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)

at System.Net.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)

--- End of inner exception stack trace ---

at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)

at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)

at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)

at MSDNMagAnnotationClient.ServiceReference1.SilverlightInkServiceClient.SilverlightInkServiceClientChannel.EndFindImages(IAsyncResult result)

at MSDNMagAnnotationClient.ServiceReference1.SilverlightInkServiceClient.MSDNMagAnnotationClient.ServiceReference1.ISilverlightInkService.EndFindImages(IAsyncResult result)

at MSDNMagAnnotationClient.ServiceReference1.SilverlightInkServiceClient.OnEndFindImages(IAsyncResult result)

at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)

--- End of inner exception stack trace ---

at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

at

would you pls give me some suggetiong ? i'm a starter silverlight

thank you

#6 Julie on 6.27.2009 at 7:46 PM

Hi Grant

You are encountering cross-domain policy/cross-site scripting issues. The web service project in my downloads has a file in it that should help you avoid the problem. I have a blog post that explains cross site scripting and points to a more indepth article by John Papa at:

http://bit.ly/Ze3Ro

hth

julie