14.14. Embedding Content in a Silverlight Application

If you want to utilize content such as images within your Silverlight application, you have a number of options, two of which are shown here:

  • Relative path + resource:

    <Image Source="myImage.jpg"></Image>
  • Full URL:

    <Image Source="http://www.mysite.com/myImage.jpg"></Image>

NOTE

Silverlight currently displays only JPG or PNG images. This means that GIF images do not display. The Silverlight team apparently left this out to reduce the size of the plug-in (not to mention GIF becoming a paid standard), but it does seem to be a weird omission. On a related note, if you are interested in manipulating images, you might be interested in checking out www.codeplex.com/imagetools.

The steps to include ...

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.