ComponentOne Bitmap for WPF
C1.WPF.Bitmap.4.5.2 Assembly / C1.WPF.Bitmap Namespace / C1Bitmap 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 Integer, _
       ByVal addTransparentColor As Boolean _
    ) As C1Bitmap.Palette
    public C1Bitmap.Palette CreatePaletteFromBitmap( 
       int colorCount,
       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