Suche GLCD funktion für kreis MIT Dicke

Gast #3697487
Lesenswert?

Hallo

Ich suche eine Funktion für ein GLCD um einen Kreis zu zeichnen, bei dem 
die Dicke der Linie mit angegeben werden kann.

Kennt jemand etwas?

Ich habe bisher das hier:

Bei diesem Code habe ich versucht die Dicke mit einzubringen.
1
void draw_circle(uint16_t x, uint16_t y, uint16_t radius, uint8_t fill, uint16_t color)
2
{
3
   signed int a, b, P;
4
   a = 0;
5
   b = radius;
6
   P = 1 - radius;
7

8
   uint8_t counter = 0;
9

10
     do
11
     {
12
      if(fill)
13
      {
14
       LCD_Line(x-a, y+b, x+a, y+b, color);
15
       LCD_Line(x-a, y-b, x+a, y-b, color);
16
       LCD_Line(x-b, y+a, x+b, y+a, color);
17
       LCD_Line(x-b, y-a, x+b, y-a, color);
18
      }
19
      else
20
      {
21
       counter = 5; //War mein versuch die Dicke einzubinden
22
       while(counter)
23
       {
24
       LCD_PutPixel(a+x+counter, b+y+counter, color);
25
       LCD_PutPixel(b+x+counter, a+y+counter, color);
26
       LCD_PutPixel(x-a-counter, b+y+counter, color);
27
       LCD_PutPixel(x-b-counter, a+y+counter, color);
28
       LCD_PutPixel(b+x+counter, y-a-counter, color);
29
       LCD_PutPixel(a+x+counter, y-b-counter, color);
30
       LCD_PutPixel(x-a-counter, y-b-counter, color);
31
       LCD_PutPixel(x-b-counter, y-a-counter, color);
32
       counter --;
33
       }
34
      }
35

36
      if(P < 0)
37
       P+= 3 + 2*a++;
38
      else
39
       P+= 5 + 2*(a++ - b--);
40
    } while(a <= b);
41

42

43
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren