Circular Gradient

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Circular Gradient

      Hello,

      I wanted to draw a circular grey gradient as showing in the attached image. The dial is used for showing temperature value and an arrow will be displayed indicating the temperature. The angle of gradient will change depending on temperature value. Is there any way this can be achieved in Emwin?

      Thanks

      Regards,

      Anuj
      Images
      • 1.png

        16.01 kB, 411×411, viewed 618 times
    • Hi Anuj,

      yes, this is possible. For use cases like this there is the KNOB widget. To actually rotate the image, the KNOB widget needs a 32-bit memory device.
      I've attached an example with your image below.

      Best regards,

      Florian
      Files
      • KnobExample.zip

        (26.37 kB, downloaded 423 times, last: )
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi Florian,

      Thanks for the example. It is working. If i want to show an arrow as attached in the image below will i have to include the arrow in the image itself which shows the temperature value or arrow can be drawn separately.

      The final image is attached which i want to achieve. The outer ring is dynamic and inner light green arc is dynamic and will change on temperature value. I believe if i use the knob widget then how will i draw the arrow, outer ring and inner light green arc.

      Regards,

      Anuj
      Images
      • Setpoint1.png

        27.14 kB, 411×411, viewed 370 times
    • Hi Anuj,

      you can draw the arrow separately, but I suppose it is just easier to add it to the bitmap instead of having to calculate the arrow position via the KNOB value.
      The colored circle/arc around your KNOB can be drawn with GUI_DrawCircle() and GUI_DrawArc(), respectively.

      Best regards,

      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hello,

      As you can see the above image Setpoint1.png, I wanted to rotate the inner knob (Black colored) using touch and the green arc color should be updated based on the knob movement.

      But I am facing issues while rotating the knob, the outer arc gets corrupted first and then it starts drawing the arc according to knob moment.

      Regards,
      Anuj
      Images
      • Step2.PNG

        15.35 kB, 338×308, viewed 353 times
      • Step1.PNG

        15.49 kB, 367×309, viewed 367 times
      Files
      • Dial_Issue.zip

        (27.08 kB, downloaded 339 times, last: )
    • Hi,

      the arc doesn't get fully redrawn. You can redraw the window e.g. by calling WM_InvalidateWindow(pMsg->hWin) after the value has been updated.

      Also calling WM_MULTIBUF_Enable(1) could come in handy to avoid flickering.

      Best regards,

      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.