Partilhar via


CDrawingManager::Fill4ColorsGradient

Fills a rectangular area with two color gradients.

void Fill4ColorsGradient(
   CRect rect,
   COLORREF colorStart1,
   COLORREF colorFinish1,
   COLORREF colorStart2,
   COLORREF colorFinish2,
   BOOL bHorz = TRUE,
   int nPercentage = 50
);

Parameters

  • [in] rect
    The rectangle to fill.

  • [in] colorStart1
    The initial color for the first color gradient.

  • [in] colorFinish1
    The final color for the first color gradient.

  • [in] colorStart2
    The initial color for the second color gradient.

  • [in] colorFinish2
    The final color for the second color gradient.

  • [in] bHorz
    A Boolean parameter that indicates whether Fill4ColorsGradient colors a horizontal or vertical gradient. TRUE indicates a horizontal gradient.

  • [in] nPercentage
    An integer from 0-100. This value indicates the percentage of the rectangle to fill with the first color gradient.

Remarks

When a rectangle is filled with two color gradients, they are either located above each other or next to each other, depending on the value of bHorz. Each color gradient is calculated independently with the method CDrawingManager::FillGradient.

This method generates an assertion failure if nPercentage is less than 0 or more than 100.

Requirements

Header: afxdrawmanager.h

See Also

Reference

CDrawingManager Class

Hierarchy Chart