Share via


BitmapPalettes.Halftone216Transparent 屬性

定義

取得值,此值表示包含 216 種主要色彩和 16 種系統色彩的色板,並包含 1 種額外的透明色彩。 調色盤中的重複色彩都已移除。 這個調色盤共有 225 種色彩。

public:
 static property System::Windows::Media::Imaging::BitmapPalette ^ Halftone216Transparent { System::Windows::Media::Imaging::BitmapPalette ^ get(); };
public static System.Windows.Media.Imaging.BitmapPalette Halftone216Transparent { get; }
static member Halftone216Transparent : System.Windows.Media.Imaging.BitmapPalette
Public Shared ReadOnly Property Halftone216Transparent As 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)

備註

BitmapPalettes 名稱結尾為 「Transparent」 的屬性具有完全透明的其他 「color」。 如果調色盤已經有 256 種色彩,最後一個色彩會由透明色彩取代。

適用於

另請參閱