BitmapPalettes.BlackAndWhite Property
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.
Gets a value that represents a black-and-white color palette. This palette consists of 2 colors total.
public:
static property System::Windows::Media::Imaging::BitmapPalette ^ BlackAndWhite { System::Windows::Media::Imaging::BitmapPalette ^ get(); };
public static System.Windows.Media.Imaging.BitmapPalette BlackAndWhite { get; }
static member BlackAndWhite : System.Windows.Media.Imaging.BitmapPalette
Public Shared ReadOnly Property BlackAndWhite As BitmapPalette
An instance of BitmapPalette.
The following code example demonstrates how to construct a new BitmapSource by using a member of the BitmapPalettes class. Although this example shows how to use the WebPalette property, you can use any member of the BitmapPalettes class in a similar way.
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)
Produit | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :