I'm selecting my brush in shape classes. So i guess i select brush two times, maybe that is the problem.
Code:
void CDrawView::OnFillcolorTransparent()
{
So what should i write here.
}
Code:
void Circle::Paint (CDC *pDC)
{
// create the pen
CPen pen(PS_SOLID, look.lineWidth, look.lineColor);
CPen *oldpen = pDC->SelectObject(&pen);
// create the brush
CBrush brush;
if (look.transparent)
brush.CreateStockObject(NULL_BRUSH);
else
brush.CreateSolidBrush(look.fillColor);
CBrush *oldbrush = pDC->SelectObject(&brush);
// draw the circle
CRect r = GetRect();
pDC->Ellipse(r);
pDC->SelectObject(oldpen);
pDC->SelectObject(oldbrush);
}