vc++ 旋转线
时间:2011-03-30 来源:zhixing
void CgdiTestDlg::Roulette(CPoint cpoint){
CClientDC dc(this);
double pi =3.1415926535;
double r =50;//半径
CPoint temp;//终点
CPen penBound;//建立画笔
for(double i = 0 ;i < 360;i=i+8){
//时间差动画测试
for(int w = 0 ; w < 10000000 ; w++){
}
dc.MoveTo(cpoint);
temp.x = 400.0 + r*cos(i*pi/180.0) - r*sin(i*pi/180.0);
temp.y = 250.0 + r*cos(i*pi/180.0) + r*sin(i*pi/180.0); //设定画笔线条颜色
penBound.CreatePen(2,1,RGB(0,0,255));
dc.SelectObject(penBound); dc.LineTo(temp);
penBound.DeleteObject();
}
}
相关阅读 更多 +