Initializes a new instance of CachedBitmap that has the specified source, bitmap create options, and bitmap cache option.
Public Sub New ( _ source As BitmapSource, _ createOptions As BitmapCreateOptions, _ cacheOption As BitmapCacheOption _ )
Dim source As BitmapSource Dim createOptions As BitmapCreateOptions Dim cacheOption As BitmapCacheOption Dim instance As New CachedBitmap(source, _ createOptions, cacheOption)
public CachedBitmap( BitmapSource source, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption )
public: CachedBitmap( BitmapSource^ source, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption )
public function CachedBitmap( source : BitmapSource, createOptions : BitmapCreateOptions, cacheOption : BitmapCacheOption )
You cannot use constructors in XAML.
Occurs when source is nullNothingnullptra null reference (Nothing in Visual Basic).
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()
CachedBitmap cachedSource = new CachedBitmap( scaledSource, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); // Create a new BitmapSource using a different format than the original one. FormatConvertedBitmap newFormatSource = 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