BitmapImage::CacheOption Property
Gets or sets the BitmapCacheOption to use for this instance of BitmapImage.
Assembly: PresentationCore (in PresentationCore.dll)
public: property BitmapCacheOption CacheOption { BitmapCacheOption get(); void set(BitmapCacheOption value); }
Property Value
Type: System.Windows.Media.Imaging::BitmapCacheOptionThe BitmapCacheOption being used for the BitmapImage. The default is BitmapCacheOption::Default.
Set the CacheOption to BitmapCacheOption::OnLoad if you wish to close a stream used to create the BitmapImage. The default OnDemand cache option retains access to the stream until the image is needed, and cleanup is handled by the garbage collector.
Identifier field | |
Metadata properties set to true | None |
The following code example demonstrates how to set the CacheOption of a BitmapImage by using code.
Available since 3.0