CachedBitmap(BitmapSource, BitmapCreateOptions, BitmapCacheOption) Constructor

Definitie

Initialiseert een nieuw exemplaar met CachedBitmap de opgegeven bron, bitmapopties en bitmapcacheoptie.

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

De bron bitmap die in de cache wordt opgeslagen.

createOptions
BitmapCreateOptions

Initialisatieopties voor de bitmapafbeelding.

cacheOption
BitmapCacheOption

Hiermee geeft u op hoe de bitmap in de cache wordt opgeslagen in het geheugen.

Uitzonderingen

Treedt op wanneer source is null.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u een CachedBitmap code maakt en gebruikt.


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()

Van toepassing op

Zie ook