Ligne 119 : |
Ligne 119 : |
| | | |
| [[Fichier:MicroPython-ILI9341-Exemples-30.jpg|480px]] | | [[Fichier:MicroPython-ILI9341-Exemples-30.jpg|480px]] |
| + | |
| + | == Cercles et ovales == |
| + | Il est également possible de dessiner des cercles et ovales facilement à l'aide de {{fname|drawCircle}}, {{fname|drawCircleFilled}}, {{fname|drawOvale |
| + | |
| + | <nowiki>drawCircle(self, x, y, radius, color, border=1, degrees=360 ) |
| + | drawCircleFilled(self, x, y, radius, color)</nowiki> |
| + | |
| + | * '''x''', '''y''' - position du centre du cercle. |
| + | * '''radius''' - rayon du cercle (en pixel) |
| + | * '''border''' - épaisseur de la bordure ('''attention''' en cours d'implementation) |
| + | * '''color''' - couleur sous la forme d'un tuple {{fname|(r,g,b)}} respectant la codification RGB565. |
| + | |
| + | <nowiki>from lcd import * |
| + | l = LCD( rate=21000000 ) |
| + | l.drawCircle( 10, 10, 5, GREEN ) |
| + | l.drawCircleFilled(120, 160, 60, RED)</nowiki> |
| + | |
| + | [[Fichier:MicroPython-ILI9341-Exemples-40.jpg|480px]] |
| + | |
| + | <nowiki>drawOvalFilled(self, x, y, xradius, yradius, color)</nowiki> |
| | | |
| == todo == | | == todo == |