Offers
Thanks for visiting www.technoexam.com. Stay connected with us for more latest programming updates...

You are here : Home >> Tutorials >> C

Go
Basic C Tutorial

Contents
What is C ?
History
Structure of C Program
Variables & Keywords
Constants
Data Types
Operators
Operators Precedence
Conditional Statements
if Statement
if else Statement
nested if else
switch case
Looping Statements
While loop
Do While loop
For loop
Break
Continue
Goto
Functions
Passing Value
Returning Value
Passing & Returning
Recursion
Storage Class
Array
Structure
Pointer
Union
Strings
Header File
Programs Library
Projects Library
Learn More+

Contact Us

+91-8806583119

graphics.h Header File in C

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

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

Output :

	circle in graphics

Download PDF
Published on: 12th Nov 2010, Last Updated on: 18th Dec 2014

Mr. Dinesh Kudache
AUTHOR: Mr. Dinesh Kudache

Mr. Dinesh is the Founder and CEO of technoexam.com. He had 6+ years experience in Application Programming, System Programming, Web Design and Development, Google Expertise. He had written 5000+ various articles on programming. Browse more articles by this author.

Link this post on your Blog/Website :