c语言仿真函数 c++仿真( 三 )


( (GetPixel(hScreenDC,x-1,y))!=(GetPixel(hScreenDC,x-1,y+1)))
( (GetPixel(hScreenDC,x+1,y))!=GetPixel(hScreenDC,x+1,y+1))
)
{
//稍稍调整坐标
if(GetPixel(hScreenDC,x,y-1)==GetPixel(hScreenDC,x,y-2))
{
y--;
}
else
{
if(GetPixel(hScreenDC,x,y-1)==GetPixel(hScreenDC,x,y-2))
y++;
x+=CrWind;
}
//画三个雪花点
SetPixel(hScreenDC,x,y,0XFFFFFF);
SetPixel(hScreenDC,x+1,y+1,0XFFFFFF);
SetPixel(hScreenDC,x-1,y+1,0XFFFFFF);
//重生雪点
SnowNodes[i].postion.x=rand()%ScreenWidth;
SnowNodes[i].postion.y=rand()%10;
SnowNodes[i].iColor=GetPixel(hScreenDC,SnowNodes[i].postion.x,SnowNodes[i].postion.y);
}
else
{
if( (x0) || (xScreenWidth) || (yScreenHeight))
{
SnowNodes[i].postion.x=(rand()%10);
SnowNodes[i].postion.y=(rand()%ScreenWidth);
SnowNodes[i].iColor=GetPixel(hScreenDC,SnowNodes[i].postion.x,SnowNodes[i].postion.y);
}
else
{
//保存颜色并绘制雪点
SnowNodes[i].iColor=GetPixel(hScreenDC,x,y);
SetPixel(hScreenDC,x,y,0XFFFFFF);
//此时保存新雪点位置
SnowNodes[i].postion.x=x;
SnowNodes[i].postion.y=y;
}
}
}
DeleteDC(hScreenDC);
CrStep++;
}
关于c语言仿真函数和c++仿真的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读