DrawLine Function (ROM Call 0x1A7)

graph.h

void DrawLine (short x0, short y0, short x1, short y1, short Attr);

Draws a line between two specified points.

DrawLine draws a line from (x0y0) to (x1y1) using the attribute Attr. The following attributes are supported:

A_NORMALDraw a normal line
A_REVERSEDraw an inverse line (i.e. erase the line)
A_XORDraw a line using XORing with the destination
A_THICK1Draw a double thick line
A_SHADE_VDraw the line using a vertical shading pattern
A_SHADE_HDraw the line using a horizontal shading pattern
A_SHADE_NSDraw the line using a negative slope diagonal shading pattern
A_SHADE_PSDraw the line using a positive slope diagonal shading pattern

See SetCurAttr command for more general info about attributes. Note that although TI said nothing about it, attributes A_SHADE_V, A_SHADE_H, A_SHADE_NS and A_SHADE_PS work only for lines with slope more than 45 degree (i.e. for lines which are more "vertical" than "horizontal"). For "nearly horizontal" lines all of them act like A_NORMAL. I don't know whether it is a bug, or planned feature. So, if you want to draw shaded-fill rectangle using DrawLine in a loop, use vertical lines for drawing, not horizontal ones!

Using DrawLine (and all other graphic comands which does not do clipping) may be harmful if called using parameters which are out of legal range (i.e. out of the screen area).


Uses: TIOS_abs
Used by: DrawClipLine, FillTriangle, ScrRectFill, MenuKey, MenuOff, MenuOn, MenuTopRedef, MenuTopSelect, GT_BackupToScr, Regraph, DrawWinBorder, WinLineNC, ROM Call 0x421, ROM Call 0x47B