Drawing 2D V U level meter on Dialog using WM Manager

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

  • Drawing 2D V U level meter on Dialog using WM Manager

    Hi I want to draw a Level Meter using 10 calls to GUI_AA_FillRoundedRect() to display the level in Various colors on my dialog "GUI_CreateDialogBox"

    All is well But the meters do NOT display unless I perform the drawing in the callback of the Dialog.

    If I try to draw outside the callback and perform invalidate or GUI_exec nothing is drawn.

    I am using STemwin STM32F429 , triple buffered.

    Whats the appropriate way to do this.redrawing at 50ms intervals

    Thanks
    Brett ^^
  • Hello Brett,

    Please note that the Window Manager works event based. All drawing operations should be performed within the callback function of the according window. Windows which need to be redrawn should be invalidated. The function GUI_Exec() or GUI_Delay() (<- calls GUI_Exec()) should be called regularly.

    For details, please refer to the chapter "The Window Manager" in the emWin user manual.

    Best regards,
    Adrian
  • Hi
    Ok so the general procedure is to draw the 2D item in the callback WM_Paint switchcase
    and timer trigger the VU meter "updates" at 50ms intervals Invalidating and then using GUI_Exec();


    I did essentially do this but found the performance very slow as it was redrawing the entire Screen every update and not just the area drawn.
    I gather I need to create another Window just for the area I need and Draw on that instead using the callback for that small window?

    Thanks
    Brett
  • Hello Brett,

    Please note that the Window Manager sends messages to all windows which are invalid, but you can also just invalidate a certain rectangular area. Of course creating a separate window is a good approach and will work, too. But you will still have to perform the drawing operations from within the callback function.

    Best regards,
    Adrian