Results 1 to 13 of 13

Thread: Drawing lines

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    USA all the way!
    Posts
    82

    Drawing lines

    how can i draw lines in console progs?
    is it easy enough for a moron like i?
    Often talked of, never seen,
    Ever coming, never been,
    Daily looked for, never here,
    Still approaching, coming near,
    Thousands for its visit wait,
    But alas for their fate,
    Tho' they expect me to appear,
    They will never find me here.

    What's this about?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163
    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++.
    Purushottam

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    USA all the way!
    Posts
    82
    i dont have borland. i use microsoft vc++.
    is there at least a way i can change pixel colors?
    Often talked of, never seen,
    Ever coming, never been,
    Daily looked for, never here,
    Still approaching, coming near,
    Thousands for its visit wait,
    But alas for their fate,
    Tho' they expect me to appear,
    They will never find me here.

    What's this about?

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    USA all the way!
    Posts
    82
    im new to c++, but i was wondering, could i use setpixelV, like in vb?
    if so, what would the dc be?
    Often talked of, never seen,
    Ever coming, never been,
    Daily looked for, never here,
    Still approaching, coming near,
    Thousands for its visit wait,
    But alas for their fate,
    Tho' they expect me to appear,
    They will never find me here.

    What's this about?

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    No, not in a console.

    They provide NO graphical facilities of ANY kind, except for making interesting text patterns.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    USA all the way!
    Posts
    82
    ok, but what about the none console apps (mfc)?
    Often talked of, never seen,
    Ever coming, never been,
    Daily looked for, never here,
    Still approaching, coming near,
    Thousands for its visit wait,
    But alas for their fate,
    Tho' they expect me to appear,
    They will never find me here.

    What's this about?

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by Killerguppy101
    ok, but what about the none console apps (mfc)?
    MFC? Ugh!

    API all the way

    Basically, any Win32 GUI program can draw whatever it wants onto its window.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    USA all the way!
    Posts
    82
    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.
    Often talked of, never seen,
    Ever coming, never been,
    Daily looked for, never here,
    Still approaching, coming near,
    Thousands for its visit wait,
    But alas for their fate,
    Tho' they expect me to appear,
    They will never find me here.

    What's this about?

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    http://winprog.org/tutorial/

    They've got a section on graphics
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163
    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)
    }
    Purushottam

  13. #13
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    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)
    }
    It won't work in Visual C++. I think it's for Borland C++ or DJ****(whatever it's called).
    Baaaaaaaaah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width