• Hi,

    I have been using emWin for quite sometime now and haven't come across this before. On a window widget I am displaying few 2 buttons and 2 images. For some reason I see 2nd image in the background of first image. I checked the parameters and made sure I am not displaying the image twice. I have been using the same procedure on a couple other windows but haven't had any problems with it.

    I'd really appreciate it if someone came across this problem and could help me or any suggestions will do.

    Thank you,
    BMD

  • Hi,

    Do you have some code which shows how to reproduce it?

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Sven,

    Thank you for quick response. Please see attached code and Images I am currently using.

    Best regards,
    BMD

  • Hi,

    Not sure why you see the second image in the background, but when removing the transparency flag of the image you should make sure you paint the entire widget area.

    In the callback functions of the image widgets you draw only the BMPs. The Service BMP is smaller than the widget and there will be some undefined space left. I could imagine that this undefined area will show any kind of artifact (on my end it was simply black).

    Try something like:


    Best 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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Sven,

    Appreciate the response. Thank you so much.
    Also, when the image is touched, it clears the entire scree. The only I know to stop that from happening is to disable the image. Is there any other efficient way of doing this?

    Best regards,
    BMD

  • Hi,


    Also, when the image is touched, it clears the entire scree.

    This shouldn't happen at all.

    For now I have no idea why this happens on your end.

    You could try to catch the touch events of the IMAGE widget and do nothing, like:


    Although, this shouldn't cause such a behavior, you could also try to remove these calls:

    C
    #if GUI_SUPPORT_MEMDEV
            WM_SetCreateFlags(WM_CF_MEMDEV);
            WM_EnableMemdev(WM_HBKWIN);
        #endif

    When using multibuffering there is little to no reason of using automatic memory devices. This will produce only an overhead in regards of drawing operations. With automatic memory devices on emWin will first write into the memory devices and then draw the memory devices onto the screen. Without memory devices emWin will write directly into the frambeuffer.

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Sven,

    Thank you so much for helping me out in figuring a better way to do things.

    I tried to remove the automatic memory devices but that's causing bitmaps on buttons on each screen to flicker. Can you help me understand what could be causing this?

    Thanks and regards,
    BMD

  • Hi,

    When using memory devices for windows/widgets emWin will draw the bitmaps at first into the memory devices. Once this is done the memory device will be displayed at once. If you are using no memory devices you might experience a visual build up of the image because they will be drawn line wise. This will result in a flickering effect.

    The most efficient way to avoid this would be either multi buffering (GUIDRV_Lin) or a cache (almost any other driver, e.g. GUIDRV_FlexColor). If you don't have enough memory for multi buffering or a cache you can still use the automatic memory devices. For multi buffering or a cache you need at least as many additional bytes to hold one complete screen (xSize x ySize x bytes per pixel). The automatic memory devices require just as many memory as the size of the window/widget (xSizeWin x ySizeWin x byte per pixel).

    More information about multi buffering can be found here:
    https://wiki.segger.com/emWin_Multi-Buffering

    A lot of users using autom memory devices in combination with multi buffering. But this is a bit over the top because there are no benefits but an overhead in drawing.

    If you can't use multibuffering or a cache, then it is time to think about automatic memory devices.

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!