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>_moveto() move graphic output position</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _moveto()               Move graphic output position

 #include   <graph.h>

 struct xycoord far _moveto( x, y );
  short x;     Horizontal logical coordinate
  short y;     Vertical logical coordinate

    _moveto() moves the current image output position to the logical
    point (x, y). The next image output will occur at that point.

       Returns:     _moveto() returns the logical coordinates of the
                    previous position (x,y) in an xycoord structure,
                    defined in graph.h:

                    struct xycoord {
                       short xcoord;    x coordinate (horizontal)
                       short ycoord;    y coordinate (vertical)
                       };

         Notes:     The graphics functions recognize two sets of
                    coordinates:

                    1. Physical coordinates determined by the hardware
                    and display configuration of the user's environment.

                    2. Logical coordinates defined by the application,
                    which can be reassigned to different physical
                    coordinates.

                    _moveto() sets the next image output position
                    according to the currently assigned logical
                    coordinates. Use _setlogorg() to displace the logical
                    coordinate system from its default physical setting.

                    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().

                    The physical coordinates of any logical point can be
                    determined using _getphyscoord(), and the logical
                    coordinates of any physical point can be determined
                    with _getviewcoord().

                    The logical and physical coordinate systems affect
                    the location of images only, and have no effect on
                    the location of text.

   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: _getcurrentposition() _lineto() _settextposition()

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