| Methods Index |
Subclassess: None
CBrush class encapsulates XVT brushes. A CBrush object describes the color and the pattern used to fill the interior of the following shapes: rectangle, rounded rectangle, oval, pie, and polygon. A CPen object is used to draw the perimeter of these closed shapes. The color is indicated by RGB values. XVT uses a 24-bit number to specify a color. The 24 bits are divided into three 8-bit values for the red, green, and blue components.
For your convenience, XVT provides symbols for the brush colors listed in Table 1. You can use other colors if you wish. However, if your target platform doesn't flexibly support color, XVT recommends that you use one of the predefined colors.
The pattern specifies the brush pattern, which has the allowable values shown in Table 2.
See Also:
For information on defining the perimeter of closed shapes, see
CPen. For information on other "environmental" attributes, see
CEnvironment.
CBrush aBrush(COLOR_RED, PAT_SOLID);
CBRUSH anXVTBrush = aBrush;
xvt_dwin_set_cbrush(itsXVTWindow, &anXVTBrush);
xvt_dwin_set_back_color(itsXVTWindow,
aBrush.GetColor());
Protected Data Members
CBrush Attributes
CBRUSH
itsBrush;
The brush
Public Methods
Constructor, Destructor, and Initializer Methods
CBrush();
CBrush(COLOR theColor, PAT_STYLE thePattern);
CBrush(CBRUSH theBrush);
CBRUSH.
CBrush(const CBrush &theBrush);
CBrush associated with theBrush.
CBrush & operator = (const CBrush &theBrush);
thebrush associated with a CBrush.
~CBrush();
operator CBRUSH () const;
CBRUSH. Since this method returns a direct reference into internal information, use this method carefully. Specifically, do not use this method in cases in which the calling method might destroy or alter the handle.
CBrush & operator = (CBRUSH theBrush);
CBRUSH.
void IBrush(COLOR theColor, PAT_STYLE thePattern);
void SetColor(COLOR theColor);
void SetPattern(PAT_STYLE thePattern);
COLOR GetColor(void) const;
PAT_STYLE GetPattern(void) const;