#include<dos.h> #include<stdio.h> #include<process.h> #include<conio.h> #include<graphics.h> void InitGraph(); void Quit(); void ThreeDBx(int,int,int,int); void ChgColor(int,int,int,int); int main() { InitGraph(); ChgColor(1,0,60,60); ChgColor(2,0,30,30); ChgColor(3,0,45,45); ChgColor(7,36,36,36); setfillstyle(1,7);bar(0,0,639,479); ThreeDBx(140,25,360,430); getch(); Quit(); return 0; } void InitGraph() { int GraphDriver=DETECT,GraphMode;
initgraph(&GraphDriver,&GraphMode,""); } void Quit() { closegraph(); exit(0); } void ThreeDBx(int x,int y,int l,int h) { int i; setcolor(2); rectangle(x,y,x+l,y+h); setfillstyle(1,2); bar(x+1,y+1,x+l-1,y+h-1); setcolor(1); for(i=0;i<6;i++){ line(x+i,y+i,x+l-i,y+i); line(x+i,y+i,x+i,y+h-i); } setfillstyle(1,3);bar(x+6,y+6,x+l-6,y+h-6); line(x+l-1,y+h-1,x+l-6,y+h-6); setcolor(2);line(x+1,y+1,x+6,y+6); setcolor(1);rectangle(x+20,y+20,x+l-20,y+h-20); setcolor(2);rectangle(x+19,y+19,x+l-21,y+h-21); } void ChgColor(int ColorNo,int Red,int Green,int Blue) { union REGS In; In.x.ax=0x1010; In.x.bx=ColorNo; In.h.dh=Red; In.h.ch=Green; In.h.cl=Blue; int86(0x10,&In,&In); } |