how can i draw lines in console progs?
is it easy enough for a moron like i?
Printable View
how can i draw lines in console progs?
is it easy enough for a moron like i?
Console mode doesn't have lines as such, unless you're faking it with clever placement of characters (it can be done, but it's not often worth it).
If you want to do anything graphical you're best off making a proper Windows program.
If U rusing Borlandc++3 or 5 U just install all the examples .There U will get very simple example of drawing circle U just go through it.However U have to use bge that comes with c++.
i dont have borland. i use microsoft vc++.
is there at least a way i can change pixel colors?
Nope, not in a console. That's definitely a text-only zone.
If you want to do graphics you'll need to learn how to make a Win32 GUI program (I'm not picking on you here, I say this to everyone, but make sure you know the language fully, all the ins and outs, before you try Windows programming).
Once you've got that, you can do the basic Windows graphical operations, then move onto the more advanced OpenGL or DirectX stuff :)
im new to c++, but i was wondering, could i use setpixelV, like in vb?
if so, what would the dc be?
No, not in a console.
They provide NO graphical facilities of ANY kind, except for making interesting text patterns.
ok, but what about the none console apps (mfc)?
MFC? Ugh! :eek: :DQuote:
Originally posted by Killerguppy101
ok, but what about the none console apps (mfc)?
API all the way ;)
Basically, any Win32 GUI program can draw whatever it wants onto its window.
if i use api, alot of the stuff i use (bitblt, setpixelv, etc) uses dc's, and i dont know how to use dc's in c++. if you could tell me how to get the dc of the window (me.hdc in vb) then that would help alot.
http://winprog.org/tutorial/
They've got a section on graphics :)
if U r working in console then
user goto_xy(x,y);
for hori
putchar(179)
for vertical
putchar(186)
for corners
putchar(218)
putchar(191)
putchar(192)
putchar(217)
for (i=startx;i<endxli++)
{
goto_xy(i,starty);
putchar(179)
}
It won't work in Visual C++. I think it's for Borland C++ or DJ****(whatever it's called).Quote:
Originally posted by purusingh
if U r working in console then
user goto_xy(x,y);
for hori
putchar(179)
for vertical
putchar(186)
for corners
putchar(218)
putchar(191)
putchar(192)
putchar(217)
for (i=startx;i<endxli++)
{
goto_xy(i,starty);
putchar(179)
}