Document Solutions for PDF
DS.Documents.Imaging.Windows Assembly / GrapeCity.Documents.Imaging.Windows Namespace / GcWicBitmap Class / CreatePaletteFromBitmap Method
The number of colors to initialize the palette with.
A value to indicate whether to add a transparent color.

In This Topic
    CreatePaletteFromBitmap Method
    In This Topic
    Creates a palette using a computed optimized values based on the bitmap.
    Syntax
    'Declaration
     
    Public Function CreatePaletteFromBitmap( _
       ByVal colorCount As System.Integer, _
       ByVal addTransparentColor As System.Boolean _
    ) As GcWicBitmap.Palette
    public GcWicBitmap.Palette CreatePaletteFromBitmap( 
       System.int colorCount,
       System.bool addTransparentColor
    )

    Parameters

    colorCount
    The number of colors to initialize the palette with.
    addTransparentColor
    A value to indicate whether to add a transparent color.
    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.
    See Also