BitmapPalettes.Gray4 Property
Definition
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 color palette that contains 4 shades of gray, ranging from black to gray to white. This palette contains 4 total colors.
public:
static property System::Windows::Media::Imaging::BitmapPalette ^ Gray4 { System::Windows::Media::Imaging::BitmapPalette ^ get(); };
public static System.Windows.Media.Imaging.BitmapPalette Gray4 { get; }
static member Gray4 : System.Windows.Media.Imaging.BitmapPalette
Public Shared ReadOnly Property Gray4 As BitmapPalette
Property Value
An instance of BitmapPalette.
Examples
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)
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기