BitmapImage 建構函式

定義

初始化 BitmapImage 類別的新執行個體。Initializes a new instance of the BitmapImage class.

多載

BitmapImage()

初始化 BitmapImage 類別的新執行個體。Initializes a new instance of the BitmapImage class.

BitmapImage(Uri)

使用所提供的 BitmapImage,初始化 Uri 類別的新執行個體。Initializes a new instance of the BitmapImage class by using the supplied Uri.

BitmapImage(Uri, RequestCachePolicy)

使用來源為 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()

初始化 BitmapImage 類別的新執行個體。Initializes a new instance of the BitmapImage class.

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

備註

BitmapImage會執行ISupportInitialize介面, 以優化多個屬性的初始化。BitmapImage implements the ISupportInitialize interface to optimize initialization on multiple properties. 若要初始化BitmapImage使用此函式所建立的, 您必須在BeginInitEndInit呼叫之間執行屬性初始化。To initialize a BitmapImage created using this constructor, you must perform property initialization between BeginInit and EndInit calls.

BitmapImage(Uri)

使用所提供的 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)

參數

uriSource
Uri

要當成 Uri 之來源使用的 BitmapImageThe Uri to use as the source of the BitmapImage.

例外狀況

uriSource 參數為 nullThe uriSource parameter is null.

找不到 uriSource 參數指定的檔案。The file specified by the uriSource parameter is not found.

備註

BitmapImage使用此函數建立的物件會自動初始化。BitmapImage objects created using this constructor are automatically initialized. 初始化之後, 會忽略屬性變更。After initialization, property changes are ignored.

另請參閱

BitmapImage(Uri, RequestCachePolicy)

使用來源為 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)

參數

uriSource
Uri

要當成 Uri 之來源使用的 BitmapImageThe Uri to use as the source of the BitmapImage.

uriCachePolicy
RequestCachePolicy

RequestCachePolicy,它會指定使用 HTTP 取得之影像的快取需求。The RequestCachePolicy that specifies the caching requirements for images that are obtained using HTTP.

例外狀況

uriSource 參數為 nullThe uriSource parameter is null.

找不到 uriSource 參數指定的檔案。The file specified by the uriSource parameter is not found.

備註

BitmapImage使用此函數建立的物件會自動初始化。BitmapImage objects created using this constructor are automatically initialized. 初始化之後, 會忽略屬性變更。After initialization, property changes are ignored.

BitmapImage(Uri, RequestCachePolicy)會在 .NET Framework 版本3.5 中引進。BitmapImage(Uri, RequestCachePolicy) is introduced in the .NET Framework version 3.5. 如需詳細資訊,請參閱版本和相依性For more information, see Versions and Dependencies.

另請參閱

適用於