本文整理汇总了C++中CBCGPDrawManager::FillGradient2方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPDrawManager::FillGradient2方法的具体用法?C++ CBCGPDrawManager::FillGradient2怎么用?C++ CBCGPDrawManager::FillGradient2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPDrawManager
的用法示例。
在下文中一共展示了CBCGPDrawManager::FillGradient2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFillBackground
//**********************************************************************
void CBCGPToolTipCtrl::OnFillBackground (CDC* pDC, CRect rect, COLORREF& clrText, COLORREF& clrLine)
{
ASSERT_VALID (pDC);
if (m_Params.m_clrFill == (COLORREF)-1)
{
CBCGPVisualManager::GetInstance ()->OnFillToolTip (pDC, this, rect,
clrText, clrLine);
}
else
{
if (m_Params.m_clrFillGradient == (COLORREF)-1)
{
CBrush br (m_Params.m_clrFill);
pDC->FillRect (rect, &br);
}
else
{
CBCGPDrawManager dm (*pDC);
dm.FillGradient2 (rect,
m_Params.m_clrFillGradient, m_Params.m_clrFill,
m_Params.m_nGradientAngle == -1 ? 90 : m_Params.m_nGradientAngle);
}
}
}
示例2: DoPaint
//**********************************************************************************
void CToolPalette::DoPaint(CDC* pDC)
{
CRect rcClient;
GetClientRect(rcClient);
CBCGPMemDC bufferDC(*pDC, rcClient);
CBCGPToolBar::DoPaint (&bufferDC.GetDC());
CBCGPDrawManager dm (bufferDC.GetDC());
bool bHorizontal = (GetCurrentAlignment() & CBRS_ORIENT_HORZ) != 0; // Toolbar layout mode
EDisplayOptions edo = GetToolbarDisplayOptions();
if ((edo & eDisplaySizeControl) != 0 && !bHorizontal)
{
const int sizeControlHeight = m_imgCaption.GetParams().m_rectImage.Height();
CRect rcSizeControl = rcClient;
rcSizeControl.bottom = rcSizeControl.top + sizeControlHeight;
m_imgCaption.Draw(pDC, rcSizeControl, 1); // 1 is the index of border image
rcClient.top += sizeControlHeight;
}
if ((edo & eDisplayTitle) != 0)
{
CString title;
GetWindowText (title);
CRect rcTitle = rcClient;
if ((edo & eDisplayBorder) != 0)
{
const CRect& rectCorners = m_imgCaption.GetParams().m_rectCorners;
rcTitle.top += rectCorners.top;
}
rcTitle.top += 1;
rcTitle.bottom = rcTitle.top + m_nCaptionHeight;
dm.FillGradient2 (rcTitle, RGB(48, 112, 202), RGB(21, 57, 111), 305);
rcTitle.DeflateRect (1, 2, 1, 2);
CFont* pOldFont = bufferDC.GetDC().SelectObject(&m_fntTitle);
bufferDC.GetDC().SetBkMode(TRANSPARENT);
bufferDC.GetDC().SetTextColor(0xFFFFFF);
bufferDC.GetDC().DrawText (title, rcTitle,
DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
bufferDC.GetDC().SelectObject (pOldFont);
}
if ((edo & eDisplayBorder) != 0)
{
m_imgCaption.DrawFrame (&bufferDC.GetDC(), rcClient, 0); // 0 is the index of border image
}
}
示例3: OnPaint
void CLoginBarToolTipCtrl::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect (rect);
CBCGPToolTipParams params;
visualManagerMFC->GetToolTipParams (params);
if (params.m_clrFill == (COLORREF)-1)
{
::FillRect (dc.GetSafeHdc (), rect, ::GetSysColorBrush (COLOR_INFOBK));
}
else
{
if (params.m_clrFillGradient == (COLORREF)-1)
{
CBrush br (params.m_clrFill);
dc.FillRect (rect, &br);
}
else
{
CBCGPDrawManager dm (dc);
dm.FillGradient2 (rect,
params.m_clrFillGradient, params.m_clrFill,
params.m_nGradientAngle == -1 ? 90 : params.m_nGradientAngle);
}
}
COLORREF clrLine = params.m_clrBorder == (COLORREF)-1 ?
::GetSysColor (COLOR_INFOTEXT) : params.m_clrBorder;
COLORREF clrText = params.m_clrText == (COLORREF)-1 ?
::GetSysColor (COLOR_INFOTEXT) : params.m_clrText;
dc.Draw3dRect (rect, clrLine, clrLine);
CFont* pPrevFont = m_pFont == NULL ?
(CFont*) dc.SelectStockObject (DEFAULT_GUI_FONT) :
dc.SelectObject (m_pFont);
dc.SetBkMode (TRANSPARENT);
dc.SetTextColor(clrText);
if (m_strText.FindOneOf (_T("\n")) != -1) // multi-line tooltip
{
rect.DeflateRect (m_nTextMargin, m_nTextMargin);
if (rect.Height () < m_rectLast.Height ())
{
// center tooltip vertically
//rect.top += (m_rectLast.Height () - rect.Height ()) / 2;
}
//dc.DrawText (m_strText, rect, DT_LEFT | DT_WORDBREAK);
DrawTextML (dc, m_strText, rect);
}
else // single line tooltip
{
rect.DeflateRect (m_nTextMargin, 0);
dc.DrawText (m_strText, rect, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX);
}
if (pPrevFont != NULL)
{
dc.SelectObject (pPrevFont);
}
}