Graphics program to draw line,Draw line in c graphics,How to draw a line in graphics c in Hindi:
![]() |
Graphics program to draw line,Draw line in c graphics,How to draw a line in graphics c in Hindi |
Line in graphics c(Hindi ):नमस्ते
दोस्तो स्वागत आपका आज हम graphics c programming के सहयता से
line को draw करना सीखेंगे आज में आपको
graphics के अंतर्गत line function के बारे में
बताऊँगा की कैसे graphics .h header file के line function का
उपयोग line को draw कर सकते है
और में आपको line function से सम्बंधित program का उदाहरण
भी बाटुंगा जिससे आप आसानी से
line function के बारे में जान सकते है तो चलिए
दोस्तो देखते है |
Coordinate &Angle in graphics c (Hindi):
दोस्तो
अगर हम किसी shapes को
draw करना चाहते है तो हमें
उसका coordinate
defined करने की आवश्यकता होती
है उसी तरह किसी लाइन को draw करने के
लिए हमें उसके coordinate को defined करना होता है coordinate का मतलब की
किसी shape को कहाँ से
start करना है और कहा
पर समाप्त करना है
उदाहरण
के लिए हमने Coordinate &Angle graphics c के लिए Hindi में defined किया है |
![]() |
Coordinate &Angle in graphics c (Hindi) |
line function in graphics c (HINDI):
line() एक
graphics c programming language में
उपस्थित एक library function है जिसका उपयोग
line को draw करने के लिए किया
जाता है | किसी भी लाइन को
draw करने के लिए दो
coordinate को
defined किया जाता है |
जैसे
उदाहरण के लिए हम
एक लाइन draw करना चाहते है तो
point(x1,y1) से
point (x2,y2) coordinate को
defined करना पड़ेगा यहाँ पर x1,y1 starting
coordinate है और x2,y2 ending
coordinate(point) है
|
syntax(Declaration of line() function in c in Hindi)
Graphics program to Draw a line
using line() in (Hindi )
//graphics
program to draw a line
#include<graphics.h>
#include<conio.h>
main()
int gd = DETECT, gm;
initgraph(&gd, &gm, “C://TC//BGI”);
// draw a line
line(100, 100 ,200, 100);
line(10, 10, 200, 10);
getch();
closegraph();
return 0;
}
Explain this Code:
उपरोक्त
program में सबसे पहले हमने Header file graphics.h तथा conio.h को defined किया गया है फिर हमने
main() function start किया
है main() function के अंदर हमने
int gd =DETECT , gm ; को
defined किया है यहाँ पर
gd का उपयोग graphics driver के लिए किया
गया है तथा DETECT graphics.h header file में पहले से डिफाइंड एक
macro है और gm का उपयोग ham graphics mode को initialize करने के लिए किया
गया है और
initgraph की सहायता से graphics driver को computer से प्रोग्राम में
lode किया है तथा graphics mode को initialize किया
गया है | फिर हमने program में line function के सहायता से
line को draw किया line function में चार perimeter को डिफाइंड किया
गया है यहाँ पर
(100,100) x1,y1 को
indicate करते है तथा (200,100) x2,y2 को
indicate करता है उसी तरह
(10,10) x1,y1 को
indicate करता है तथा (200,10) x2,y2 को indicate करता
है और getch() function का प्रयोग
screen को रोकने के लिए किया
गया जब तक कोई
key press न किया जाये और graphics को close करने के लिए closegraph function का प्रयोग किया
गया है तथा end में
return 0; से पूरे program को
बंद किया गया है |
Output of Line in graphics c (Hindi ):
Output of Line in graphics c (Hindi ):
Draw line from using lineto() function in Hindi:
lineto()भी
graphics programming language में
उपस्थित एक library function है जिसका उपयोग
current point से लाइन को दूसरे point पर draw करने
के लिए किया जाता है |
उदाहरण
के लिए यदि हम किसी लाइन
को current पॉइंट से दूसरे point पर
draw करना चाहते है तो केबल
हमें (x,y)
coordinate को
defined करना होता है जिससे line current point से (x,y) coordinate पर draw हो जाती है
जैसे -current point से हमें किसी
line को (100,200)
coordinate तक draw करना है यह पर
(100) x coordinate को
indicate करता है और (200) y coordinate को indicate करता
है |
syntax of lineto
function in Hindi
lineto(x,y);
line program in graphics c using lineto function (HINDI):
// Draw line from
current point to (x,y) point using lineto() function(Hindi)
#include<graphics.h>
#include<conio.h>
main()
{
int gd =DETECT, gm;
initgraph(&gd, &gm, “C://TC//BGI”);
//draw a line
lineto(100, 200);
getch();
closegraph();
return 0;
}
उपरोक्त
program में सबसे पहले हमने Draw line in graphics c के बारे में जाना है अब हम दिए गए कोड को विस्तार से समझेगे सबसे पहले हमने Header file graphics.h तथा conio.h को defined किया गया है फिर हमने
main() function start किया
है main() function के अंदर हमने
int gd =DETECT , gm ; को
defined किया है यहाँ पर
gd का उपयोग graphics driver के लिए किया
गया है तथा DETECT graphics.h header file में पहले से डिफाइंड एक
macro है और gm का उपयोग ham graphics mode को initialize करने के लिए किया
गया है और
initgraph की सहायता से graphics driver को computer से प्रोग्राम में
lode किया है तथा graphics mode को initialize किया
गया है |फिर हमने lineto() function के अंदर दो
peramitor (x,y) को
defined किया है जहाँ पर
x की value 100 तथा y की value 200 है linto() function line
monitor के start
coordinate से (x ,y)
coordinate तक line को draw करता है| और getch() function का प्रयोग
screen को रोकने के लिए किया
गया जब तक कोई
key press न किया जाये और graphics को close करने के लिए closegraph function का प्रयोग किया
गया है तथा end में
return 0; से पूरे program को
बंद किया गया है | दोस्तो आपको नीचे दिए गए Output में अच्छे से समझ में
आ जायेगा |
Output of draw line using lineto function (Hindi):
![]() |
Output of draw line using lineto function (Hindi) |
Graphics function in c language in Hindi:
line();
bar();
circle();
rectangle();
ellipse();
getcolor();
getmaxcolor();
getmaxx();
getmaxy();
outtextx();
outtexty();
outtextxy();
setbkcolor();
setfillstyle();
Conclusion:
दोस्तो यदि
आपको हमारा
यह post अच्छा
लगा हो
तो आप
हमें comments करके
बता सकते
हो आपको
हमने graphics c programming in hindi में
पूरी तरह
बताया है
अगर दोस्तो
आपको कोई
problem होती है
तो आप
हमे comment कर
के बता
सकते है
धन्यवाद दोस्तो
हमारी इस
website को विजिट
करने के
लिए |
0 Post a Comment: