Share via


BitmapPalettes.Halftone8 屬性

定義

取得值,此值表示包含 8 種主要色彩和 16 種系統色彩的色板,其中重複的色彩都已移除。 在這個調色盤中共有 16 種色彩,這些色彩與系統調色盤相同。

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

屬性值

BitmapPalette

BitmapPalette 的執行個體。

範例

下列程式碼範例示範如何使用 類別的成員 BitmapPalettes 來建構新的 BitmapSource 。 雖然此範例示範如何使用 WebPalette 屬性,但您可以用類似的方式使用 類別的任何成員 BitmapPalettes

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)

適用於

另請參閱