[]
Creates a palette using a computed optimized values based on the bitmap.
public C1Bitmap.Palette CreatePaletteFromBitmap(int colorCount, bool addTransparentColor)
Type | Name | Description |
---|---|---|
int | colorCount | The number of colors to initialize the palette with. |
bool | addTransparentColor | A value to indicate whether to add a transparent color. |
Type | Description |
---|---|
C1Bitmap.Palette |
The resulting palette contains the specified number of colors which best represent the colors present in the bitmap. The algorithm operates on the opaque RGB color value of each pixel in the reference bitmap and hence ignores any alpha values. If a transparent color is required, set the addTransparentColor parameter to true and one fewer optimized color will be computed, reducing the colorCount, and a fully transparent color entry will be added.