共用方式為


CMFCColorBar::InitColors

Initializes an array of colors with the colors in a specified palette, or with the system default palette.

static int InitColors(
   CPalette* pPalette, 
   CArray<COLORREF, COLORREF>& arColors
);

Parameters

Parameter

Description

[in] pPalette

A pointer to a palette object, or NULL. If this parameter is NULL, this method uses the default palette of the operating system.

[in] arColors

An array of colors.

Return Value

The number of elements in the array of colors.

Requirements

Header: afxcolorbar.h

See Also

Reference

Hierarchy Chart

CMFCColorBar Class

COLORREF

CPalette Class