Note: |
|---|
Silverlight does not support all image formats. See BitmapImage for information on the types of image sources and formats that can be used for an Image. |
You can set the Source by specifying an absolute URL (e.g. http://contoso.com/myPicture.jpg) or specify a URL relative to the XAP file of your application.
If Height and Width are not set, the Image displays with the natural height and width of its source image file.
If the Source property is set to an invalid format, or is specified to an ImageSource that was not properly constructed, then the ImageFailed event is raised.
An Image potentially has asynchronous behavior. This happens if the Source is set either by directly specifying a URI in XAML, or is set to a BitmapImage that is being newly constructed using a URI. Until the source is resolved and the image source decoded, layout will occur but the image will be treated as an element of 0 size if it did not specify Height and Width, or as a blank area of that size if Height and Width are specified. Once the URI is resolved and the image source is decoded, another layout pass is initiated.
Silverlight uses bitmap caching. Therefore, if an image has been requested by URI before, the cached and decoded image is used again rather than initiating a new request from the URI.
See BitmapImage for information on the types of image sources and formats that can be used for an Image.