纯粹的初中知识,不知道有多少人还清楚的记得公式。
CPaintDC dc(this); // device context for painting
int x , y;
x = y = 200;
int a ,b ;
a = b = 100;
int r = 60;
const float PI = 3.141592653589f;
float i = 0.0f;
while(i < PI*2)
{
i = i + 0.0011f;
int px = x + r * cos(i);
int py = y - r * sin(i);
Sleep(1);
dc.SetPixel(px, py, RGB(128, 128, 128) );
}
CDialog::OnPaint();