BitmapImage Constructor (Uri)
Collapse the table of content
Expand the table of content

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.

Namespace:  System.Windows.Media.Imaging
Assembly:  System.Windows (in System.Windows.dll)

public BitmapImage(
	Uri 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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft