Visual Basic
C#
Managed Extensions for C++
C++/CLI
If the ImageX does not have a palette then an empty palette is returned.
The Palette property returns and sets a palette in one operation. Like the System.Drawing.Bitmap class, the Palette can not be modified on the fly.
For instance, the following code does not change the first entry in ImageX's palette to Red.
The following code is the correct way to modify the first entry to Red.
C# | ![]() |
---|---|
imageX.Palette.Entries[0] = System.Drawing.Color.Red; |
C# | ![]() |
---|---|
System.Drawing.Imaging.ColorPalette palette;
palette = imageX.Palette;
if ( palette.Entries.Length > 0 )
{
palette.Entries[0] = System.Drawing.Color.Red;
imageX.Palette = palette;
} |