microsoftxiao

记忆 流逝

导航

GDIPlus抛物线渐变

const cpxn = -400;
int cpx = cpxn;

int Render()
{
 if(i>100){
       i = 0;
    InvalidateRect(hWnd,&rect,true);
 }
 if(cpx > 600){
  cpx = cpxn;
 }
    //InvalidateRect(hWnd,&rect,true);
    Graphics graphics(hdc); 
 GraphicsPath path;
 
 Pen pen(Color(255,0,255,0),1);
 
 /*if(i<50){
  cpx = rand()%550;
 }else
 {
        cpx = - (rand()%300);
 }*/
   
 Point p[] = {Point(100,100),
           Point(300,cpx),Point(300,cpx),
              Point(500,100)};

    graphics.TranslateTransform(150, 260);
    graphics.DrawBeziers(&pen,p,4);
 
    cpx+= 10;
    i++;
 Sleep(50);
 return 0;
}

posted on 2006-10-04 10:41  龙巢NET刀  阅读(6540)  评论(7编辑  收藏  举报