Edytuj

Udostępnij za pośrednictwem


BitmapImage Constructors

Definition

Initializes a new instance of the BitmapImage class.

Overloads

BitmapImage()

Initializes a new instance of the BitmapImage class.

BitmapImage(Uri)

Initializes a new instance of the BitmapImage class by using the supplied Uri.

BitmapImage(Uri, RequestCachePolicy)

Initializes a new instance of the BitmapImage class with an image whose source is a Uri, and is cached according to the provided RequestCachePolicy.

BitmapImage()

Initializes a new instance of the BitmapImage class.

public:
 BitmapImage();
public BitmapImage ();
Public Sub New ()

Remarks

BitmapImage implements the ISupportInitialize interface to optimize initialization on multiple properties. To initialize a BitmapImage created using this constructor, you must perform property initialization between BeginInit and EndInit calls.

Applies to

BitmapImage(Uri)

Initializes a new instance of the BitmapImage class by using the supplied Uri.

public:
 BitmapImage(Uri ^ uriSource);
public BitmapImage (Uri uriSource);
new System.Windows.Media.Imaging.BitmapImage : Uri -> System.Windows.Media.Imaging.BitmapImage
Public Sub New (uriSource As Uri)

Parameters

uriSource
Uri

The Uri to use as the source of the BitmapImage.

Exceptions

The uriSource parameter is null.

The file specified by the uriSource parameter is not found.

Remarks

BitmapImage objects created using this constructor are automatically initialized. After initialization, property changes are ignored.

See also

Applies to

BitmapImage(Uri, RequestCachePolicy)

Initializes a new instance of the BitmapImage class with an image whose source is a Uri, and is cached according to the provided RequestCachePolicy.

public:
 BitmapImage(Uri ^ uriSource, System::Net::Cache::RequestCachePolicy ^ uriCachePolicy);
public BitmapImage (Uri uriSource, System.Net.Cache.RequestCachePolicy uriCachePolicy);
new System.Windows.Media.Imaging.BitmapImage : Uri * System.Net.Cache.RequestCachePolicy -> System.Windows.Media.Imaging.BitmapImage
Public Sub New (uriSource As Uri, uriCachePolicy As RequestCachePolicy)

Parameters

uriSource
Uri

The Uri to use as the source of the BitmapImage.

uriCachePolicy
RequestCachePolicy

The RequestCachePolicy that specifies the caching requirements for images that are obtained using HTTP.

Exceptions

The uriSource parameter is null.

The file specified by the uriSource parameter is not found.

Remarks

BitmapImage objects created using this constructor are automatically initialized. After initialization, property changes are ignored.

BitmapImage(Uri, RequestCachePolicy) is introduced in the .NET Framework version 3.5. For more information, see Versions and Dependencies.

See also

Applies to