资源描述:
《用c语言实现按钮新技术》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、用C语言实现按钮新技术 一、按钮显示原理按钮一般有按下和弹起两种状态,在3Dstudio中按钮也有这两种状态,ain(){intgdriver=DETECT.gmode=VGAHI:button*but,*but1.*but2.*bt,*but3,*but4,*but5,*but6,*but7;intch;initgraph(gdriver,gmode,"d:tc");setcolor(ScreenBkColor);setbkcolor(2);clrscr();ButtonDefine(but,50,50,600,400);putDoe(delay);}close
2、graph():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);setfillstyle(1,7);bar(START-X,START-Y,END-X,END-Y);setcolor(ButtonWhite);setfillstyle(1,7);bar(START-X+Grap,START-Y+Grap
3、,END-X-Grap,END-Y-Grap);setcolor(15);for(j=0;j<=Grap;j++){line(START-X,j+START-Y,END-X-j,j+STAT-Y);}for(i=0,i<=Grap;j++){line(START-X+i,START-Y+Grap,START-X+i,END-Y-i);}setcolor(ButtonBlack);for(j=0;j<Grap;j++)}line(END-X,j+END-Y-Grap,START-X+Grap-j,j+END-Y-Grap);}for(i=0,i<
4、;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<=delay)i++;}button.htypedefstructButtonDef{shortx1;shorty1;shortx2;shorty2;}button;作者:庞剑飞