Published on: 12th Nov 2010    |   Last Updated on: 24th Nov 2011

graphics.h header file :

↓↓Download graphics.h Header File

The 'graphics.h' header file is used to declare graphics functions. It declares prototypes for the graphics functins.

Some of the standard member functions of graphics.h header files are,


Function Name Description
initgraph - Used to initilize graphics and load graphics driver.
line - Used to draw a line as line(x1,y1,x2,y2).
bar - Used to draw rectangle with diagonal, bar(x1,y1,x2,y2).
circle - Used to draw circle, circle(x1,y1,radius).
cleardevice - It clears the graphics screen.
closegraph - Closes or shut downs graphics system.
rectangle - Used to draw a rectangle.
setcolor - It sets the current drawing color.
getcolor - It returns the current drawing color.
floodfill - Used to flood-fill bounded region.
settextstyle - It sets current text features.
ellipse - It draws ellipse, as ellipse(x,y,start,end,xrad,yrad).


Program :

/*  Program to demonstrate graphics.h header file working.
Creation Date : 6:12 PM 08/11/2010
Author : www.technoexam.com [Technowell, Sangli] */

#include <stdio.h> #include <conio.h> #include <graphics.h> void main() { int gdriver=DETECT, gmode; clrscr(); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); circle(70,70,20); getch(); closegraph(); }

Output :


	circle in graphics

Link this post on your Blog/Website :

Follow us on :   Technoexam on facebook Technoexam on twitter Technoexam on linkedin Technoexam on youtube