ColorPalette.CreateOptimalPalette(Int32, Boolean, Bitmap) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.