Bewerken

Share via


ColorPalette.CreateOptimalPalette(Int32, Boolean, Bitmap) Method

Definition

Creates an optimal color palette based on the colors in a given bitmap.

public:
 static System::Drawing::Imaging::ColorPalette ^ CreateOptimalPalette(int colors, bool useTransparentColor, System::Drawing::Bitmap ^ bitmap);
public static System.Drawing.Imaging.ColorPalette CreateOptimalPalette (int colors, bool useTransparentColor, System.Drawing.Bitmap bitmap);
static member CreateOptimalPalette : int * bool * System.Drawing.Bitmap -> System.Drawing.Imaging.ColorPalette
Public Shared Function CreateOptimalPalette (colors As Integer, useTransparentColor As Boolean, bitmap As Bitmap) As ColorPalette

Parameters

colors
Int32

The number of colors you want to have in an optimal palette based on a the specified bitmap.

useTransparentColor
Boolean

true to include the transparent color in the palette; otherwise, false.

bitmap
Bitmap

The bitmap to base the optimal color palette off of.

Returns

The optimal color palette for the specified bitmap.

Applies to