BitmapImage.CacheOption Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the BitmapCacheOption to use for this instance of BitmapImage.

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

member CacheOption : BitmapCacheOption with get, set

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

CacheOptionProperty

Metadata properties set to true

None

The following code example demonstrates how to set the CacheOption of a BitmapImage by using code.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: