#5 computer graphics programming in c

Subscribers:
16,600
Published on ● Video Link: https://www.youtube.com/watch?v=gVwwcpzo-Ks



Category:
Tutorial
Duration: 7:06
4,308 views
26


In low quality video resolution you can not see the program output. Program output circle line is thin so you can not see it low quality video.

watch in 1080p.

#computergraphics #drawpoly #cgi #computerprograming #GPU #vectorgraphics #c #c++ #2018 #2019 #software


THE PATH:

"C:\\Turboc3\\BGI"

depends upon the turbo c software you use and the BGI folder path in your operating system drive (c drive).

download links to turbo c:

http://sourceforge.net/projects/turbocforwindows-9/

https://turbocpp.codeplex.com/

http://www.softpedia.com/get/Programming/Coding-languages-Compilers/TurboCplusplus-for-Windows-7.shtml

http://indiaexam.in/turbo-c-download-windows-7-64-bit-full-screen.html


download link to 7-Zip 15.06 Beta (64-bit) :

http://filehippo.com/download_7-zip_64/

http://www.winzipdownload.org/



INITGRAPH FUBCTION :

initgraph(&gd, &gm, "C:\\TC\\BGI");

1- In C graphics programming you have to use standard library functions ( need not worry if you don't know functions ) to get your task done. Just you pass arguments to the functions and it's done.

2- Firstly you should know the function initgraph which is used to initialize the graphics mode .

3- To initialize graphics mode we use initgraph function in our program.

4- initgraph function is present in "graphics.h" header file, so your every graphics program should include "graphics.h" header file.

5- Firstly let me tell you what is the output of this program, this program initializes graphics mode and then closes it after a key is pressed.

6- To begin with we have declared two variables of int type gd and gm for graphics driver and graphics mode respectively, you can choose any other variable name as you wish.

7- DETECT is a macro defined in "graphics.h" header file, then we have passed three arguments to initgraph function first is the address of gd, second is the address of gm and third is the path where your BGI files are present ( you have to adjust this accordingly where you turbo compiler is installed).

8- Initgraph function automatically decides an appropriate graphics driver and mode such that maximum screen resolution is set, getch helps us to wait until a key is pressed, closegraph function closes the graphics mode and finally return statement returns a value 0 to main indicating successful execution of your program.

9- After you have understood initgraph function then you can use functions to draw shapes such as circle, line , rectangle etc, then you can learn how to change colors and fonts using suitable functions, then you can go for functions such as getimage, putimage etc for doing animation.


CLOSEGRAPH FUNCTION :

closegraph();

closegraph function closes the graphics mode, deallocates all memory allocated by graphics system and restores the screen to the mode it was in before you called initgraph.

Declaration :- void closegraph();


GRAPHICS.H FUNCTIONS :


arc
bar
bar3d
circle
cleardevice
closegraph
drawpoly
ellipse
fillellipse
fillpoly
floodfill
getarccords
getbkcolor
getcolor
getdrivername
getimage
getmaxcolor
getmaxx
getmaxy
getpixel
getx
gety
graphdefaults
grapherrormsg
imagesize
line
lineto
linerel
moveto
moverel
outtext
outtextxy
pieslice
putimage
putpixel
rectangle
sector
setbkcolor
setcolor
setfillstyle
setlinestyle
settextstyle
setviewport
textheight
textwidth

There are 16 colors declared in graphics.h as listed bellow.

BLACK: 0
BLUE: 1
GREEN: 2
CYAN: 3
RED: 4
MAGENTA: 5
BROWN: 6
LIGHTGRAY: 7
DARKGRAY: 8
LIGHTBLUE: 9
LIGHTGREEN: 10
LIGHTCYAN: 11
LIGHTRED: 12
LIGHTMAGENTA: 13
YELLOW: 14
WHITE: 15



FOR MORE DETAILS FEEL FREE TO VIST :

http://www.programmingsimplified.com/c/graphics.h

http://electrosofts.com/cgraphics/

SPECIAL THANKS TO THE ABOVE MENTIONED SITES.




Thanks for your great time and patience to read till the end of the description.

Thanks to YouTube and Google.
------------------------------------------------------------------------------------------------







Tags:
Algorithm (Literature Subject)
Computer (Industry)
computer graphics programming in c
graphics programming in c
computer graphics programming
graphics in c
c (programming language)
computer graphics programs
c programs
how to use drawpoly
drawpoly in c
drawpoly
computer graphics program
c++
vikramnvp11
solution domain
computer graphics
how to c++
computer graphics tutorial for beginners
computer graphics programming in c tutorial