Skip to main content
Junde
Senior III
October 17, 2024
Solved

How to use the circle progress?

  • October 17, 2024
  • 3 replies
  • 1937 views

Hi,

I want to show a circle progress like below:

Junde_1-1729159898639.png

In touchgfx's circleProgress, there is't the little circle at the progress line end;

So I am drawing the little circle and update its position realtime;

Is there any simpler way to do the same things?

And more, I need the sine() and the cosine() to calculate the position of the little circle, I find some info from HERE, but I don't know how to use it. Is there any example?

Thanks!

 

    This topic has been closed for replies.
    Best answer by Mohammad MORADI ESFAHANIASL

    Hello @Junde,

    Unfortunately, you have to manually move/animate the circle. You can use the provided Easing Equations for animating the movement of the circle. 
    Also, it would be easier to use the sin() or cos() functions that are available in math.h since the functions you mentioned are used for sophisticated drawings. But, if you really like to use them, you can see how they are used in the source code for Circle. You can access Circle.cpp from your installed TouchGFX directory\touchgfx\framework\source\touchgfx\widgets\canvas

    I hope this helps you!
    Don't hesitate to ask more questions if you have any!

    3 replies

    ST Employee
    October 17, 2024

    Hello @Junde,

    Unfortunately, you have to manually move/animate the circle. You can use the provided Easing Equations for animating the movement of the circle. 
    Also, it would be easier to use the sin() or cos() functions that are available in math.h since the functions you mentioned are used for sophisticated drawings. But, if you really like to use them, you can see how they are used in the source code for Circle. You can access Circle.cpp from your installed TouchGFX directory\touchgfx\framework\source\touchgfx\widgets\canvas

    I hope this helps you!
    Don't hesitate to ask more questions if you have any!

    Mohammad MORADIST Software Developer | TouchGFX
    Junde
    JundeAuthor
    Senior III
    October 18, 2024

    Thank you @Mohammad MORADI ESFAHANIASL 

    math.h is work well.

    ST Employee
    October 18, 2024

    Glad to hear! :D

    You're very welcome!

    Best regards,

     

    Mohammad MORADIST Software Developer | TouchGFX