views:

38

answers:

2

Is it possible to load in an image from another domain using JavaScript, and then pass the image to a Silverlight control on my page?

+2  A: 

The only workaround I'm familiar with for this, since it's a security issue, is to set up a web service on a server you have control over, request the image from this web service from your Silverlight application, then have the service grab the image from the other server and return it to the client.

Michael Todd
+2  A: 

Loading cross-domain images should not be an issue in Silverlight, at least if you are using the normal Image control. I just tested this with a really simple application containing only an Image control with the Source property set to an image from google images.

Are you loading your images in some funky way with the WebClient? Cross-scheme and cross-zone access is restricted for the Image class, so you would not be able to load an image (on any domain) over SSL if you loaded your XAP over regular HTTP.

The MSDN page on Silverlight URL Access Restrictions gives you a good overview of what you can and cannot do with Image, MediaElement, WebClient, and streaming video.

Dan Auclair
Not able to get this to work. Are you sure?
skb
I am sure it works for me. I'm not sure as to the context of how you are loading the images, but I am sure the normal Image control in Silverlight will load images no problem cross-domain.
Dan Auclair