FabGL
ESP32 Display Controller and Graphics Library

◆ drawLine()

void drawLine ( int  X1,
int  Y1,
int  X2,
int  Y2 
)

Draws a line specifying initial and ending coordinates.

The line has the current pen color.

Parameters
X1Starting horizontal coordinate.
Y1Starting vertical coordinate.
X2Ending horizontal coordinate.
Y2Ending vertical coordinate.

Example:

// Paint a blue X over the whole canvas
Canvas.setPenColor(Color::BrightBlue);
Canvas.drawLine(0, 0, Canvas.getWidth() - 1, Canvas.getHeight() - 1);
Canvas.drawLine(Canvas.getWidth() - 1, 0, 0, Canvas.getHeight() - 1);

Definition at line 256 of file canvas.cpp.