BitmapImage Constructor (Uri)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the BitmapImage class, using the supplied URI.
Assembly: System.Windows (in System.Windows.dll)
Parameters
- uriSource
- Type: System.Uri
The URI that references the source graphics file for the image.
The string provided for uriSource is interpreted as a Uniform Resource Identifier (URI). This is in contrast to an Internationalized Resource Identifier (IRI). This distinction means that you will need to encode characters that are outside of US-ASCII which are used to identify a file name.
Relative references are permitted. The starting location for the relative reference is the installation folder of the application.
The format-specific file name extensions such as .png are not necessarily required to be in the URI, but if the retrieved file is determined not to be a valid image format, a run-time exception is thrown.