Computer graphics is one of the most powerful and interesting aspects of computers. There is a lot that we can do in graphics apart from drawing figures of various shapes. All video games, animation, multimedia predominantly works with computer graphics. To work with graphics, C has various library functions. Some of built in functions which are defined within header file graphics.h are illustrated in this chapter. Let us see one example which demonstrates graphics initialization and some built in functions related to graphics. #include<graphics.h> void main() { int gDriver=DETECT,gMode; int polyArray[]={200,100,250,150,300,200,350,200,300,150,200,100}; initgraph(&gDriver,&gMode,"c:\\tc\\bgi"); setcolor(GREEN); line(200,100,300,250); /*line from (200,100) to (300,250) */ circle(300,300,50); /*circle at center (300,300) having radius 50 */ ellipse(150,200,0,360,100,50); /* ellipse at center (150,200) and angle from 0 to
Learn something about IT