/* Graphics Program */ #include #include #include #include #include #include #include int main () { clrscr (); int gdriver = DETECT, gmode, errorcode; initgraph (&gdriver, &gmode, "g:\\tcl\\bgi"); errorcode = graphresult (); if (errorcode != grOk) { printf ("Graphics error: %s\n", grapherrormsg (errorcode)); printf ("Press Anykey to halt: "); getch (); exit (1); } /* "graphics main prorgam lines" go here */ setcolor (GREEN); setbkcolor (RED); line (0, 0, getmaxx(), getmaxy()); line (getmaxx(), 0, 0, getmaxy() ); moveto (0, 0); lineto (getmaxx(), 0); moveto (0, 0); lineto (getmaxy(), 0); moveto (0, 0); lineto (0, getmaxx() ); line (0, getmaxy(), getmaxx(), getmaxy() ); line (getmaxx(), 0, getmaxx(), getmaxy() ); setcolor (BLUE); outtextxy (240, 150, "This is only a test!"); getch (); closegraph (); return 0; }