BitmapPalettes Class
.NET Framework 3.0
Defines several color palettes that are commonly used by bitmap images.
Namespace: System.Windows.Media.Imaging
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
BitmapPalettes that end in Transparent have an additional "color" appended to the end of them that is fully transparent. In the case of palettes that already have 256 colors, the last color will be replaced by the transparent color.
Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) image formats support palettes.
The following code example demonstrates how to construct a new BitmapSource by using a member of the BitmapPalettes class.
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)
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: