BitmapPalette Constructor (BitmapSource^, Int32)

 

Initializes a new instance of the BitmapPalette class based on the specified BitmapSource. The new BitmapPalette is limited to a specified maximum color count.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

public:
[SecurityCriticalAttribute]
BitmapPalette(
	BitmapSource^ bitmapSource,
	int maxColorCount
)

Parameters

bitmapSource
Type: System.Windows.Media.Imaging::BitmapSource^

The source bitmap from which the palette is read or constructed.

maxColorCount
Type: System::Int32

The maximum number of colors the new BitmapPalette can use.

Exception Condition
ArgumentNullException

The bitmapSource parameter is null.

If the bitmapSource already has a defined palette, the corresponding palette is returned. Otherwise, a new palette is constructed from an analysis of the bitmap.

The following example demonstrates how to retrieve a BitmapPalette from an image.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: