CachedBitmap(BitmapSource, BitmapCreateOptions, BitmapCacheOption) Constructor

Definición

Inicializa una nueva instancia de que tiene las opciones de creación de mapa de CachedBitmap bits y de origen especificadas y caché de mapa de bits.

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)

Parámetros

source
BitmapSource

Mapa de bits de origen que se almacena en caché.

createOptions
BitmapCreateOptions

Opciones de inicialización para la imagen de mapa de bits.

cacheOption
BitmapCacheOption

Especifica cómo se almacena en caché el mapa de bits en la memoria.

Excepciones

Se produce cuando source es null.

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear y usar un elemento CachedBitmap en el código.


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

Se aplica a

Consulte también