Introduction of Computer graphics using C

‘C’ is the language of choice for the system programming. It also provides the facility to draw the graphics on the screen. All the graphical related functions are kept in the header file graphics.h. C is a popular programming language. It supports computer graphics and provides number of standard library functions for drawing regular diagrams and figure on the computer screen. One can use these graphical functions to draw the images easily through computer program. For these we need to initialize the graphics mode and detect the related graphics drivers. The standard library functions are kept in the header file called “graphics.h”. for using any of the graphical built-in functions “graphics.h” file must be included.

Computer Graphics terms

Pixel : It is the smallest recognizable picture part on the computer screen. Each dot(.) we can draw on the computer screen id a pixel and any image or picture we draw is the combinations of pixels

Resolution: The maximum number of pixels we can put on the computer screen along X-axis is called its resolution. The higher resolution leads to fine quality of an image. Usually it is 640 pixels along X-axis and 480 pixels along Y-axis. But these resolution changes from computer to computer-based on configuration and operating system as well as applications used.

Coordinate system: usually the coordinate system in C computer graphics considers only positive coordinates with integer values. The left top corner of the screen is origin and X keeps on increasing along X-axis horizontally upto right border of the screen and Y keeps on increasing vertically down until button border o the screen

Graph mode : Integer that specifies the initial graphics mode (unless graph driver=DETECT is specified). If graph driver = DETECT, initgraph sets graph mode to the highest resolution available for the detected driver. We can give graph mode a value using a constant of the ‘graphics_modes’ enumeration type available in graphics.h header file.

Leave a Comment