Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_lineto() draw a line</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _lineto()               Draw a line

 #include   <graph.h>

 short far _lineto( x, y );
  short x;     Horizontal logical coordinate
  short y;     Vertical logical coordinate

    _lineto() draws a line from the current image output position to the
    logical point (x, y). The next image output will occur at that point.

       Returns:     If successful, _lineto() returns a nonzero value,
                    otherwise it returns 0.

         Notes:     The dimensions of the x and y axes depend on the
                    available display hardware and the selected video
                    mode. These values are accessible at run time by
                    examining the numxpixels and numypixels members of
                    the videoconfig structure returned by
                    _getvideoconfig().

                    If you use _floodfill() to fill in a closed figure
                    drawn with _lineto() calls, the figure must be drawn
                    in a solid line-style pattern.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

 -------------------------------- Example ---------------------------------

    This program draws a line from point 80, 20 to 240, 100.

           #include <conio.h>
           #include <graph.h>

           main()
           {
              struct xycoord xy;
              short pix_row, pix_col;

              _setvideomode( _MRES4COLOR );

              /* move to logical point 80, 20 */
              _moveto( 80, 20 );
              /* draw line from logical point 80, 20 to 240, 100 */
              _lineto( 240, 100 );

              while ( !kbhit() );
              _setvideomode( _DEFAULTMODE );
           }


See Also: _setlinestyle() _moveto() _settextposition()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson