Arpit wrote:
I am writing the following code in onPaint()
:-
void CDlgCircularChild::OnPaint()
{
CPaintDC dc(this);
CPen MyPen1;
MyPen1.CreatePen(PS_SOLID,0,RGB(255,0,0));
CBrush MyBrush1;
MyBrush1.CreateSolidBrush(RGB(255,0,0));
Ellipse(dc,20,20,80,80);
MyPen1.DeleteObject();
MyBrush1.DeleteObject();
//CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}
i m getting an circle with black border and white innerfill.Why I m not
getting effects of color in border and inside.
You have not done anything with the pen and brush you created!
CPen* pOldPen = dc.SelectObject(&MyPen1);
CBrush* pOldBrush = dc.SelectObject(&MyBrush1);
dc.Ellipse(20,20,80,80);
dc.SelectObject(pOldPen);
dc.SelectObject(pOldBrush);
--
Scott McPhillips [VC++ MVP]