Bienvenido a los foros de FT81x Manía. Te invitamos a regístrate totalmente gratis. Disfruta de tu experiencia con un grandes amigos y Staff.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Thread Contributor: raufjayHow to draw ARC

I could not find any direct command to draw arc. I am trying to draw wifi signal symbol.
Uff this is one the most pursuit "self made widget". 

The approach must be reached mixing some basic primitives like "line" and maybe "point", but require some skills on programming.

Let me finish some urgents on my work, in order to find some useful example.
Better response on post RE: How to draw ARC     I made a ready function to draw an ARC.
By using this simple function, we can draw an ARC of any size, in any line thickness, at any angle, any where on the screen.
Please see attached code with examples and pictures.
Good luck

*  Tested on STM32F103C8T6 with FT811 5" LCD.
*  This example will plots arc at any where in any angle with all possible line thickness.
*  void arc(int x, int y, int la, int ra, int s, int t)
  * x,y = co-ordinates
  * la= left side angle from 0 to 360
  * ra= right side angel from 0 to 360
  * s = size of the arc, the distance of arc from x,y
  * t = line thickness 1 to 4080.
  * c = color in 0xffffff
*  This code or part of this code is free for any one to use without
*  any obligation.
*  Abdul Rauf Jangda


void setup()

void loop()




void arc(int x, int y, int la, int ra, int s, int t,int c)
{  GD.Begin(POINTS);
  GD.ColorRGB(c);                // select the color
  for(int i=la;i<ra;i+=1)
     int xi,yi;
     GD.polar(xi,yi,s,i*180);          // calculates xy co-ordinates of arc point.
hello,nice code
The arc function is good but it is too heavy on the FT8xx internal command buffer. As it sends a lot of instructions and it is so easy to fill up FT811 command buffer before it sends out swap() command. Resulting in rebooting the screen with exceptions happens with famous Red color Spanish warning. :).
Future tech must look into it and come up with some macro command as they made for lines, points and rects for example.

Forum Jump:

Users browsing this thread: 1 Guest(s)