Description
Draw a filled ellipse.
Signature
void TFT_eSPI::drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color)
Parameters
ìnt16_tx0: center x coord.ìnt16_ty0: center y coord.ìnt32_trx: ellipse x radius.ìnt32_try: ellipse x radius.uìnt16_tcolor: filling color.
Result
None
Example
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
tft.init();
tft.fillScreen(TFT_BLACK); // clear the screen
}
void loop() {
// Draw a circle with a white border
tft.fillEllipse(120, 120, 50, 20, TFT_WHITE);
delay(1000);
}
In this example, we use fillEllipse to draw an ellipse with the following parameters:
x: 120 (the x-coordinate of the center of the circle)y: 120 (the y-coordinate of the center of the circle)radius x: 50 (the x radius of the ellipse)radius y: 20 (the y radius of the ellipse)color: TFT_WHITE (the color of the ellipse)
This will draw a filled ellipse with white color, centered at (120, 120) with a x radius of 50 pixels and a y radius
of 20 pixels.
If you want to draw the ellipse with a colored border, you can use the drawEllipse method instead.