16,472
社区成员
发帖
与我相关
我的任务
分享
void CMyEdit::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Erase back ground
CRect rect;
GetClientRect(&rect);
dc.FillSolidRect(&rect,RGB(255,255,128));//a bit yellow
// draw a solid circle
double pi=3.1415926535897932384626433832795;
for(double R=0.1;R<60.0;R+=0.1)
{
for(double angle=0;angle<2*pi;angle+=0.01)
{
double X=rect.Width()/2+R*sin(angle);
double Y=rect.Height()/2-R*cos(angle);
dc.SetPixel((int)(X),(int)(Y),RGB(255,0,0));//red
}
}
}