Syntax:
Line(LineX1,LineY1, LineX2, LineY2, Optional LineColour = 1)
Explanation:
Draws a line on a GLCD from pixel LineX1, LineY1 to pixel LineX2, LineY2.
LineColour can be specified. Typically the value is 0 or 1, corresponding to GLCDBackground and GLCDForeground respectively; it defaults to 1 (foreground) if omitted.
Example:
#include <glcd.h>
line 0,0,127,63 ' <<< the Line instruction
line 0,63,127,0
line 40,0,87,63
line 40,63,87,0Key line: line 0,0,127,63 — draws a diagonal line from the top-left corner to the bottom-right corner of a 128x64 display.
image::lineb1.PNG[graphic,align="center"]
See Also:
- GLCD Overview — category overview
- PSet — setting a single pixel rather than a line
- Box — drawing a rectangle from two corner points

