资源描述:
《当代用c语言实现按钮新技术》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、当代用C语言实现按钮新技术一、按钮显示原理按钮一般有按下和弹起两种状态,在3Dstudio中按钮也有这两种状态,ain(){intgdriver=DETECT.gmode=VGAHI:button*but,*but1.*but2.*bt,*but3,*but4,*but5,*but6,*but7;intch;initgraph(%26amp;gdriver,%26amp;gmode,"d:tc");setcolor(ScreenBkColor);setbkcolor(2);clrscr();ButtonDefine(but,5
2、0,50,600,400);putDownButton(but);ButtonDefine(but1,150,200,200,250);ButtonDefine(but2,200+dis,200,250+dis,250);ButtonDefine(but3,250+2*dis,200,300+2*dis,250);ButtonDefine(but4,300+3*dis,200,350+3*dis,250);ButtonDefine(but5,350+4*dis,200,400+4*dis,250);ButtonDefine(bu
3、t6,400+5*dis,200,450+5*dis,250);ButtonDefine(but7,450+6*dis,200,500+6*dis,250);e(delay);}closegraph():return0;}voidButtonDefine(button*bt.shortx1,shorty1,shortx2,shorty2){START-X=x1;START-Y=y1;END-X=x2;END-Y=y2;}voidReleaseButton(button*bt){inti,j;setcolor(7);setfill
4、style(1,7);bar(START-X,START-Y,END-X,END-Y);setcolor(ButtonWhite);setfillstyle(1,7);bar(START-X+Grap,START-Y+Grap,END-X-Grap,END-Y-Grap);setcolor(15);for(j=0;j%26lt;=Grap;j++){line(START-X,j+START-Y,END-X-j,j+STAT-Y);}for(i=0,i%26lt;=Grap;j++){line(START-X+i,START-Y+
5、Grap,START-X+i,END-Y-i);}setcolor(ButtonBlack);for(j=0;j%26lt;Grap;j++)}line(END-X,j+END-Y-Grap,START-X+Grap-j,j+END-Y-Grap);}for(i=0,i%26lt;Grap;i++){line(i+END-X+Grap,END-Y-Grap,i+END+X-Grap,START-Y+Grap-i);}return;}voidPutDoe(longinti){i=0;while(i%26lt;=delay)i++;
6、}button.htypedefstructButtonDef{shortx1;shorty1;shortx2;shorty2;}button;