Invalidate/Redraw only small portion of the screen

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

  • Invalidate/Redraw only small portion of the screen

    Dear all,

    I am trying to experiment a feature - My application is having a home screen and a couple of configuration screens.
    Home screen has a portion displaying some parameter values at the top and option to switch to various configuration screens (on button press. These buttons are placed as a row at the bottom of the home screen.)
    In all of my configuration screen, I need the top and bottom portion of the home screen to be retained as such. The center portion of the configuration screen defines the actual screen content.

    While drawing the configuration screen, in order to optimize the GUI performance, I would like to draw only the changed portion of the screen keeping the top and bottom portion of home screen as such.

    I was searching in emWin user manual and noticed a concept called "Virtual screens". The section says:- Virtual screens can be used for panning.
    Run the sample programs available with emWin like VSCREEN_RealTime. This example has three screens - intro, temperature plotting screen and a color selection screen.
    But all these screens are displayed as independent screens.

    I assume if parameters of GUI_SetOrg() method in the example program is adjusted, I would get the output similar to my requirement. [portion of first screen retained and following screens are drawn over that]
    But I failed to achieve my target.

    Could you please shed some light on this issue? I am now blocked in this issue.

    Thank you for your valuable support.
    Looking forward to hear from you soon,'

    Regards,
    Lullaby
  • Hi,

    So you want the black area updated and the red and green ones should stay the same?



    You could splitt the screen in several windows.
    Having one window at the top, one in the middle and one at the bottom. If something changes in the middle one the others will be untouched.
    Or you create one main screen and a smaller window in the middle.

    I wouldn't use virtual screens, it makes more sense to use the required memory for multi buffering.

    Regards,
    Sven
    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 Sven,

    I understood the point.
    Still I am looking for the possibility of using virtual screen plus some other method to implement the same.

    When I was going through the emwin user manual, accidentally noticed a feature called "Transparency".

    "A window that has transparency contains areas that are not redrawn with the rest of
    the window. These areas operate as though the window behind "shows through"
    them. In this case, it is important that the window behind is redrawn before the window
    with transparency. The WM automatically handles redrawing in the correct order."


    I am imagining how I can use this transparency feature to fit my requirement.
    My thought is:- My home screen contains top header, middle portion and bottom header. Design every screen as virtual screens. All my other screen has the top header portion transparent and the rest of the screen is each window's its own content. That way, I can keep the top header portion of every screen global. Also adjust every screen's resolution to be same as home screen so that i can use virtual screen feature also.

    But I am really confused on how to implement this.
    Could you please share your thoughts on this?
    I would appreciate if you could provide me with an example code.

    Thank you,
    Lullaby