[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.Windows.GcWicBitmap.CreatePaletteFromBitmap

CreatePaletteFromBitmap Method

CreatePaletteFromBitmap(int, bool)

Creates a palette using a computed optimized values based on the bitmap.

Declaration
public GcWicBitmap.Palette CreatePaletteFromBitmap(int colorCount, bool addTransparentColor)
Public Function CreatePaletteFromBitmap(colorCount As Integer, addTransparentColor As Boolean) As GcWicBitmap.Palette
Parameters
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.

Returns
Type Description
GcWicBitmap.Palette
Remarks

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.