Condividi tramite


CDrawingManager::GrayRect

Fills a rectangle with a specified gray color.

BOOL GrayRect(
   CRect rect,
   int nPercentage = -1,
   COLORREF clrTransparent = (COLORREF)-1,
   COLORREF clrDisabled = (COLORREF)-1
);

Parameters

  • [in] rect
    The rectangular area to fill.

  • [in] nPercentage
    The percentage of gray you want in the rectangle.

  • [in] clrTransparent
    The transparent color.

  • [in] clrDisabled
    The color that this method uses for de-saturation if nPercentage is set to -1.

Return Value

TRUE if the method was successful; otherwise FALSE.

Remarks

For the parameter nPercentage, a lower value indicates a darker color.

The maximum value for nPercentage is 200. A value larger than 200 does not change the appearance of the rectangle. If the value is -1, this method uses clrDisabled to limit the saturation of the rectangle.

Requirements

Header: afxdrawmanager.h

See Also

Reference

CDrawingManager Class

Hierarchy Chart