microsoftxiao

记忆 流逝

导航

反比例函数图象

float rota = 0.0f;
float zrota = 1.0f;

int Render()
{
 if(rota > 10.0f || rota < -60.0f){
  zrota = -zrota;
 }
 
    Graphics graphics(hdc); 
 GraphicsPath path;
 
 Pen pen(Color(255,0,255,0),1);

 SolidBrush sBrs(Color(255,0,0,0));
 Brush *brs = sBrs.Clone();

 Point p[] = {Point(100,100),
           Point(100,200),Point(200,200),
     Point(200,200)};
 Point p2[] = {Point(0,200),
            Point(100,200),Point(100,300),
               Point(100,300)};
    path.AddBeziers(p,4);
 path.AddBeziers(p2,4);
 graphics.RotateTransform(-rota);
    graphics.TranslateTransform(600, 50);
 graphics.DrawPath(&pen,&path);
 
    graphics.FillRectangle(brs,Rect(0,0,300,100));
    graphics.FillRectangle(brs,Rect(200,100,100,100));
 //InvalidateRect(hWnd,&rect,true);
 rota+= zrota;
 Sleep(1);
   
 return 0;
}

posted on 2006-10-04 15:59  龙巢NET刀  阅读(1033)  评论(0编辑  收藏  举报