FabGL2 2.0.0
ESP32 Display Controller and Graphics Library for ESP-IDF
Loading...
Searching...
No Matches

◆ drawLine()

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

Draws a line between the specified start and end coordinates.

The line is drawn with 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.