CachedBitmap(BitmapSource, BitmapCreateOptions, BitmapCacheOption) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of CachedBitmap that has the specified source, bitmap create options, and bitmap cache option.
public:
CachedBitmap(System::Windows::Media::Imaging::BitmapSource ^ source, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public CachedBitmap (System.Windows.Media.Imaging.BitmapSource source, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
new System.Windows.Media.Imaging.CachedBitmap : System.Windows.Media.Imaging.BitmapSource * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.CachedBitmap
Public Sub New (source As BitmapSource, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption)
Parameters
- source
- BitmapSource
The source bitmap that is being cached.
- createOptions
- BitmapCreateOptions
Initialization options for the bitmap image.
- cacheOption
- BitmapCacheOption
Specifies how the bitmap is cached to memory.
Exceptions
Occurs when source
is null
.
Examples
The following code example shows how to create and use a CachedBitmap in code.
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();
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()
Applies to
See also
Tee yhteistyötä kanssamme GitHubissa
Tämän sisällön lähde on GitHubissa, jossa voit myös luoda ja tarkastella ongelmia ja pull-pyyntöjä. Katso lisätietoja osallistujan oppaasta.