BitmapPalettes.BlackAndWhiteTransparent Propiedad

Definición

Obtiene un valor que representa una paleta de colores blanco, negro y transparente. Esta paleta se compone de 3 colores en total.

public:
 static property System::Windows::Media::Imaging::BitmapPalette ^ BlackAndWhiteTransparent { System::Windows::Media::Imaging::BitmapPalette ^ get(); };
public static System.Windows.Media.Imaging.BitmapPalette BlackAndWhiteTransparent { get; }
member this.BlackAndWhiteTransparent : System.Windows.Media.Imaging.BitmapPalette
Public Shared ReadOnly Property BlackAndWhiteTransparent As BitmapPalette

Valor de propiedad

BitmapPalette

Instancia de BitmapPalette.

Ejemplos

En el ejemplo de código siguiente se muestra cómo construir un nuevo BitmapSource mediante un miembro de la BitmapPalettes clase . Aunque en este ejemplo se muestra cómo usar la WebPalette propiedad , puede usar cualquier miembro de la BitmapPalettes clase de una manera similar.

BitmapSource image5 = BitmapSource.Create(
    width,
    height,
    96,
    96,
    PixelFormats.Indexed1,
    BitmapPalettes.WebPalette,
    pixels,
    stride);

FileStream stream5 = new FileStream("palette.tif", FileMode.Create);
TiffBitmapEncoder encoder5 = new TiffBitmapEncoder();
encoder5.Frames.Add(BitmapFrame.Create(image5));
encoder5.Save(stream5);
Dim image5 As BitmapSource = System.Windows.Media.Imaging.BitmapSource.Create(width, height, 96, 96, PixelFormats.Indexed1, BitmapPalettes.WebPalette, pixels, stride)

Dim stream5 As New FileStream("palette.tif", FileMode.Create)
Dim encoder5 As New TiffBitmapEncoder()
encoder5.Frames.Add(BitmapFrame.Create(image5))
encoder5.Save(stream5)

Comentarios

BitmapPalettes propiedades cuyos nombres terminan con "Transparent" tienen un "color" adicional que es totalmente transparente. En el caso de las paletas que ya tienen 256 colores, el último color se reemplaza por el color transparente.

Se aplica a

Consulte también