Freigeben über


CDrawingManager::HighlightRect

Highlights a rectangular area.

BOOL HighlightRect(
   CRect rect,
   int nPercentage = -1,
   COLORREF clrTransparent = (COLORREF)-1,
   int nTolerance = 0,
   COLORREF clrBlend = (COLORREF)-1
);

Parameters

  • [in] rect
    A rectangular area to highlight.

  • [in] nPercentage
    A percentage that indicates how transparent the highlight should be.

  • [in] clrTransparent
    The transparent color.

  • [in] nTolerance
    An integer between 0 and 255 that indicates the color tolerance.

  • [in] clrBlend
    The base color for blending.

Return Value

TRUE if the method is successful; otherwise FALSE.

Remarks

If nPercentage is between 0 and 99, HighlightRect uses the alpha blending algorithm. For more information about alpha blending, see Alpha Blending Lines and Fills. If nPercentage is -1, this method uses the default highlight level. If nPercentage is 100, this method does nothing and returns TRUE.

The method uses the parameter nTolerance to determine whether to highlight the rectangular area. To highlight the rectangle, the difference between the background color of your application and clrTransparent must be less than nTolerance in each color component (red, green, and blue).

Requirements

Header: afxdrawmanager.h

See Also

Reference

CDrawingManager Class

Hierarchy Chart