背景类源代码:
CClockBackground::~CClockBackground()
{
}
void CClockBackground::Draw(CDC *pDC)
{
CPen penMain(PS_SOLID, 1, m_crMain), penOther(PS_SOLID, 1, m_crOther);
CBrush brMain(m_crMain), brOther(m_crOther);
CPen *pOldPen = pDC->SelectObject(&penOther);
CBrush *pOldBrush = pDC->SelectObject(&brMain);
CPoint ptCenter = m_rcRegion.CenterPoint();
int nRadius = m_nRadius - 8;
for(int i = 0; i Ellipse(rcDot);
}
pDC -> SelectObject(&penMain);
pOldBrush = pDC -> SelectObject(&brOther);
for(i = 0; i Rectangle(rcDot);
}
pDC -> SelectObject(pOldPen);
pDC -> SelectObject(pOldBrush);
}
1