Using functions of graphics.h in Turbo C compiler you can make graphics programs, animations, projects, and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. Following is a list of functions of graphics.h header file.
C graphics using graphics.h functions or WinBGIM (Windows 7) can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h in Turbo C compiler you can make graphics programs, animations, projects, and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. Following is a list of functions of graphics.h header file. Every function is discussed with the arguments it needs, its description, possible errors while using that function and a sample C graphics program with its output.
C graphics examples
1. Drawing concentric circles#include <graphics.h>
int gd = DETECT, gm;
int x =320, y =240, radius;
for( radius =25; radius <=125; radius = radius +20)
circle(x, y, radius);
2. C graphics program moving car#include <graphics.h>
int i, j =0, gd = DETECT, gm;Antares autotune evo cracked pc.
outtextxy(25,240,'Press any key to view the moving car');
User can allow a MISI controller and begin tweaking tool. Camel crusher vst plugin free download. List of VST plugins and softwares: CamelCrusher:It is a free shading multi-impact module. It also offers two typically different mutilation sounds that can be mixed to make a wide assortment of surfaces and tones.
for( i =0; i <=420; i = i +10, j++)
if( i 420)
if( j 15)
cleardevice();// clear screen
C graphics functions
C graphics programs
Graphics in Windows 7 or Vista
Most of the functions are two dimensional except bar3d which draws a 3d bar, you can also implement these functions using already existing algorithms. You can also use these functions in C++ programs. You can use these functions for developing programs in Windows 7 and Vista using Dev C++ compiler. For that you need to download an additional package WinBGIm, download WinBGIm. Now open Dev C++ compiler go to Tools->Package Manager, use install button and then browse the package location. Now create a new project and select WinBGIm. This library also offers many functions which can be used for image manipulation, you can open image files, create bitmaps and print images, RGB colors and mouse handling.
How to use graphics.h in latest IDE's & Editors 2018
Just Follow the Steps for CODE::BLOCKS :-
- Clone the files from this repository. And download the Code::Blocks.
- Now copy the graphics.h & winbgim.h header files in
- Now copy the libbgi.a library file in
Header Files In C Programming
Note: It may possible that your codeblocks installation is in another folder like Program Files(x86) by default codeblocks is installed in this directory. So find your path accordingly.
Now open your codeblocks and go to
Settings > Compiler Settings > Linker Settings. Click on
Addto link libraries and browse your libbgi.a library file; should be like
In Linker Settings paste these linkers in Other linker options.
🎉 🤘Now run any graphics program. Remember that your program should be like name_of_file.
Cdoesn't support sstream.
For Dev C++ you have to do the same upto Linker step. You need to add linkers with the project, just paste the linkers in
Project Options > Parameters > Linkers. Or You can do it every project by pasting it in
Tools > Compiler Options > General > in second textbox
Just Follow the Steps for Atom :-
Header File In C++
- Clone the files from this repository. And download the Atom.
- Download the GCC compiler MinGW. And install it. Mark all options for installation.
- Set the path for the compiler. Go to
Control Panel > System > Advanced System Settings > Environment Variables > Path > Edit > New > paste C:MinGWbin
- Now open the Atom and install a package
gpp-compilerfrom press (ctrl + comma) it'll open settings > Install.
- After that paste those linkers, go to
Open settings > Packages > Settings of gpp-compiler package > C++ Compiler Options.
- Done! Create new file and press f5 to run the program.
- First Download the suitable binary file, according to your Linux OSThe current release of SDL_bgi is 2.2.3. To compile it from sources, you will need a compiler (gcc or clang are fine), make, and SDL2. On Debian and Ubuntu-like distributions, you will need the package 'libsdl2-dev' and its dependencies.
Building has been tested on GNU/Linux Mint 18.*, Fedora 26, Windows (MSYS2 + mingw-w64, Code::Blocks, Dev-C++ ), and Mac OS X Yosemite.
- Sources: SDL_bgi-2.2.3.tar.gz
- Source RPM package: SDL_bgi-2.2.3-1.src.rpm
- 64 bit binary RPM package (Fedora): SDL_bgi-2.2.3-1.x86_64.rpm
- 64 bit binary DEB package, for Debian-like Linux distributions: sdl_bgi_2.2.3-1_amd64.deb
- binaries for Windows (MSYS2 + mingw-w64, CodeBlocks, Dev-C++):
- Previous versions sources:
How To Use Graphics Header File In Dev C++
To compile a program using SDL_bgi, make sure that it includes the 'graphics.h' header file. Then:
gcc -o program program.c -lSDL_bgi -lSDL2
If you want to integrate this with your favourite editors the simply add linker.