Thread: ...my line func...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    7

    ...my line func...

    hey my line function compiles and everything but when i call it, it does not draw a line, here is the code:

    void draw(int x1, int y1, int x2, int y2)
    {
    tagPOINT pts[2] ;
    pts[0].x = x1 ;
    pts[0].y = y1 ;
    pts[1].x = x1 ;
    pts[1].y = y1 ;

    CONSOLE_SCREEN_BUFFER_INFO csbi ;
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE) ;

    GetConsoleScreenBufferInfo(hConsole, &csbi) ;
    Polyline((HDC)hConsole, pts, 2) ;
    }

    anyone have a clue?

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    The console can't do win32 API GDI functions (like Polyline).
    zen

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    7
    DOH! that sucks...

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    7
    i'ved tried all the graphic libs in the source section of the site, but the program has an error every time i run it. i use MVC++ 6.0
    since i am using a console app can i use assembly to draw graphics?

  5. #5
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    No, the only graphics the console is capable of is ASCII (drawing with characters).
    zen

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    7
    K, thx!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading a file line by line
    By Raskalnikov in forum C Programming
    Replies: 8
    Last Post: 03-18-2009, 11:44 PM
  2. Pointer and Polymorphism help.
    By Skyy in forum C++ Programming
    Replies: 29
    Last Post: 12-18-2008, 09:17 PM
  3. Printing Length of Input and the Limited Input
    By dnguyen1022 in forum C Programming
    Replies: 33
    Last Post: 11-29-2008, 04:13 PM
  4. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 05:44 PM
  5. Adding Line numbers in Word
    By Mister C in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 06-24-2004, 08:45 PM