BitmapPalettes.Gray256 Properti

Definisi

Mendapatkan nilai yang mewakili palet warna yang berisi 256 nuansa abu-abu, mulai dari hitam hingga abu-abu hingga putih. Palet ini berisi 256 warna total.

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

Nilai Properti

Instans BitmapPalette.

Contoh

Contoh kode berikut menunjukkan cara membuat baru BitmapSource dengan menggunakan anggota BitmapPalettes kelas. Meskipun contoh ini menunjukkan cara menggunakan WebPalette properti , Anda dapat menggunakan anggota BitmapPalettes kelas dengan cara yang sama.

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)

Berlaku untuk

Lihat juga