This documentation is archived and is not being maintained.
CachedBitmap Class
Visual Studio 2008
Provides caching functionality for a BitmapSource.
Assembly: PresentationCore (in PresentationCore.dll)
A BitmapSource does not cache bitmap data automatically. Using a CachedBitmap can improve performance in scenarios where multiple operations (such as clipping an image or scaling) need to be performed on a single bitmap.
The following code example shows how to create and use a CachedBitmap in code.
Dim cachedSource As New CachedBitmap(scaledSource, BitmapCreateOptions.None, BitmapCacheOption.OnLoad) ' Create a new BitmapSource using a different format than the original one. Dim newFormatSource As New FormatConvertedBitmap() newFormatSource.BeginInit() newFormatSource.Source = cachedSource newFormatSource.DestinationFormat = PixelFormats.Gray32Float newFormatSource.EndInit()
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: