+ 3
How can I include graphics in my C ++ programs?
:(
12 Respostas
+ 10
Check these resources ,
hope, it may helps u
Also use search bar before posting ur question
https://www.sololearn.com/discuss/578649/?ref=appz
https://www.sololearn.com/discuss/1635464/?ref=app
https://www.sololearn.com/discuss/1953789/?ref=app
https://www.sololearn.com/discuss/497504/?ref=app
https://www.sololearn.com/discuss/1726226/?ref=app
https://www.sololearn.com/discuss/1717385/?ref=app
https://www.sololearn.com/discuss/774071/?ref=app
https://www.sololearn.com/discuss/1284876/?ref=app
https://www.sololearn.com/discuss/453077/?ref=app
https://www.sololearn.com/discuss/2088083/?ref=app
https://www.sololearn.com/discuss/2039938/?ref=app
https://www.sololearn.com/discuss/962224/?ref=app
https://www.sololearn.com/discuss/2071892/?ref=app
https://www.sololearn.com/discuss/1299421/?ref=app
+ 8
Here is example of graphics program u can see. If u want to use graphics in program first u need graphics.h header file then u have to write graphics driver gdriver ,gmode .
hope this will help you.
#include<graphics.h> #include<stdio.h>
#include<conio.h>
void main(void)
{
int gdriver = DETECT, gmode; int x1 = 200, y1 = 200;
int x2 = 300, y2 = 300;
clrscr();
initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
line(x1, y1, x2, y2);
getch();
closegraph();
}
+ 7
Here, it doesn't work
+ 7
If u will increase first parmtr then line will start from left , second para.. for give space from top to down , and last para for end of line 3rd to change angle
+ 7
Mouli đž u can draw arc through arc function and u can also use ellipse decrease 5and 6th parameter for half shape
For arc this is syntex
arc(x, y, start_angle, end_angle, radius);
 Â
+ 7
Mouli đž Write any functions name .
Like
line () and first put all values 0,0,0,0
line(10,0,0,0); and change all values one by one after practice u can find exact place where u want to draw
 line from a point(x1,y1) to point(x2,y2) i.e. (x1,y1) and (x2,y2) are end points of the line
+ 6
Mouli đž line function take four parameters . Coordinate are working as same as when you plot any graph in graph paper.
+ 6
Mouli đž if u waana line from one end to last end u can write like this
line(10,230,200,500);
+ 6
Mouli đž arc is use to draw ellipse shape it take 3parameter
+ 2
yes, but in compilers for pc
+ 2
Thank you
0
You can include a library function for graphics
i.e, #include<graphic.h>
in Turbo C++