LINETO, LINETO_W

Graphics Function: Draws a line from the current graphics position up to and including the end point.

Module: USE DFLIB

Syntax

result = LINETO (x, y)
result = LINETO_W (wx, wy)


x, y
(Input) INTEGER(2). Viewport coordinates of end point.


wx, wy
(Input) REAL(8). Window coordinates of end point.

Results:

The result is of type INTEGER(2). The result is a nonzero value if successful; otherwise, 0.

The line is drawn using the current graphics color, logical write mode, and line style. The graphics color is set with SETCOLORRGB, the write mode with SETWRITEMODE, and the line style with SETLINESTYLE.

If no error occurs, LINETO sets the current graphics position to the viewport point (x, y), and LINETO_W sets the current graphics position to the window point (wx, wy).

If you use FLOODFILLRGB to fill in a closed figure drawn with LINETO, the figure must be drawn with a solid line style. Line style is solid by default and can be changed with SETLINESTYLE.


Note: The LINETO routine described here is a QuickWin routine. If you are trying to use the Win32 SDK version of the LineTo routine by including the DFWIN module, you need to specify the routine name as MSFWIN$LineTo. For more information, see Special Naming Convention for Certain QuickWin and Win32 Graphics Routines in the Programmer's Guide.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS

See Also: GETCURRENTPOSITION, GETLINESTYLE, GRSTATUS, MOVETO, POLYGON, POLYLINEQQ, SETLINESTYLE, SETWRITEMODE

Example

This program draws the figure shown below.

! Build as QuickWin or Standard Graphics
USE DFLIB
INTEGER(2) status
TYPE (xycoord) xy

CALL MOVETO(INT2(80), INT2(50), xy)
status = LINETO(INT2(240), INT2(150))
status = LINETO(INT2(240), INT2(50))
END

Figure: Output of Program LINETO.FOR