.DrawLine()

back to FEHLCD

Description

This function is used to draw a line which goes from the pixel pair (x1, y1) to the pixel pair (x2, y2) on the screen. The line will be the color set by the most recent use of LCD.SetFontColor().

Syntax

.DrawLine( int x1, int y1, int x2, int y2 )

Parameters

x1: integer pixel position in x direction for start of line (min 0, max 319)
y1: integer pixel position in y direction for start of line (min 0, max 239)
x2: integer pixel position in x direction for end of line (min 0, max 319)
y2: integer pixel position in y direction for end of line (min 0, max 239)

Returns

None.

Examples

#include <FEHLCD.h>

int main(void)
{
    //Draw a diagonal line through the middle of the screen
    LCD.SetFontColor(LIGHTGOLDENRODYELLOW);
    LCD.DrawLine(20,20,300,220);
}

Leave a Reply

Your email address will not be published. Required fields are marked *