Graphics programming in C Language is discussed rarely. Today I will discuss some important functions of graphics.h in C programming Language and in the next coming article I will make a simple program to demonstrate the use of graphics functions. This is the part one of the article which discuses the important graphics function to create and destroy the graphics environment. In part two I will show you different graphics functions to draw shapes. And in last part I will add a sample program to demonstrate the use of graphics.h library. So let’s start with the description of important functions and their use.

Below are the important functions and their description mostly used in graphics applications in C Language.

Function initgraph()

This function is used to load the graphics drivers and initialize the graphics system. For every function, that uses graphics mode, graphics mode must be initialized before using that function.

Path determines that path to the specified graphics driver.

Function detectgraph()

Detectgraph function determines the graphics hardware in the system, if the function finds a graphics adapter then it returns the highest graphics mode that the adapter supports.

Function cleardevice()

This function clears the graphics screen contents and return the control to the location (0,0).

Function closegraph()

This function shutdown the graphics mode and returns to the position it was before the initgraph() function was called. The closegraph() function releases all the resources occupied by the graphics system like memry, fonts, drivers etc…