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;
}
浙公网安备 33010602011771号