NIHONG.CPP
资源名称:C++100.rar [点击查看]
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:
Windows编程
开发平台:
Visual C++
- #include<graphics.h>
- #include<conio.h>
- #include<dos.h>
- void DRAWPICTURE(void);
- void CHANGE_PALETTE(void);
- void main(void)
- {
- int driver=DETECT,mode;
- int NUM1,NUM2;
- registerbgidriver(EGAVGA_driver);
- initgraph(&driver,&mode,"");
- DRAWPICTURE();
- getch();
- CHANGE_PALETTE();
- getch();
- closegraph();
- }
- void DRAWPICTURE(void)
- {
- int NUM;
- void DRAWPAN(int X,int Y,int R,int COLOR);
- for(NUM=1;NUM<16;NUM++)
- {
- DRAWPAN(40*NUM,350,50,NUM);
- }
- }
- void DRAWPAN(int X,int Y,int R,int COLOR)
- {
- setcolor(WHITE);
- setfillstyle(1,COLOR);
- pieslice(X,Y,45,135,R);
- }
- void CHANGE_PALETTE(void)
- {
- int NUM1=1,NUM2=1;
- while(1)
- {
- for(NUM1=1;NUM1<16;NUM1++)
- {
- setpalette(NUM1,NUM1+NUM2);
- delay(20);
- if(kbhit()) return;
- }
- NUM2++;
- if(NUM2==16) NUM2=1;
- }
- }