pDC->SelectStockObject(m_nColor)是什么意思?

谢谢

第1个回答  2008-06-06
参数是一个索引,目的是得到系统预定义的画刷、字体、以及字体。

Selects a CGdiObject object that corresponds to one of the predefined stock pens, brushes, or fonts.

virtual CGdiObject* SelectStockObject(
int nIndex
);

Parameters
nIndex
Specifies the kind of stock object desired. It can be one of the following values:

BLACK_BRUSH Black brush.

DKGRAY_BRUSH Dark gray brush.

GRAY_BRUSH Gray brush.

HOLLOW_BRUSH Hollow brush.

LTGRAY_BRUSH Light gray brush.

NULL_BRUSH Null brush.

WHITE_BRUSH White brush.

BLACK_PEN Black pen.

NULL_PEN Null pen.

WHITE_PEN White pen.

ANSI_FIXED_FONT ANSI fixed system font.

ANSI_VAR_FONT ANSI variable system font.

DEVICE_DEFAULT_FONT Device-dependent font.

OEM_FIXED_FONT OEM-dependent fixed font.

SYSTEM_FONT The system font. By default, Windows uses the system font to draw menus, dialog-box controls, and other text. In Windows versions 3.0 and later, the system font is proportional width; earlier versions of Windows use a fixed-width system font.

SYSTEM_FIXED_FONT The fixed-width system font used in Windows prior to version 3.0. This object is available for compatibility with earlier versions of Windows.

DEFAULT_PALETTE Default color palette. This palette consists of the 20 static colors in the system palette.