Displaying changing text with transparant background

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

  • Displaying changing text with transparant background

    Hi I want to display text with a transparent background. So instead of the text having a rectangular background of what ever color, It should not have a background hence have a transparent background. Now the SetTextMode(GUI_TM_TRANS) makes the text background transparent but when you have changing values the previous value ends up not cleared and you end up with filled in squares.

    Now there must be a way to do this I see many users wanting to display text over a bitmap.
  • Thanks for the response sven, yes that works, I have put the code in my while loop that displays the changing value. Now I am going to try and use the window manager way. I have not used the windows manager and don't know anything about it, I am assuming it basically acts like the way windows handles controls.

    There is one main issue though is that you see the flicker as it redraws the background and then writes the new text over it. Doesn't the GUI library support double buffering or something? How do you get round this flicker issue? If the text is very small then its not so much of a problem but it becomes apparent when displaying larger text.
  • Hi,

    emWin supports multi buffering. If configured properly in the LCDConf.c a call of WM_MULTIBUF_Enable(1) enables the automatic use of multibuffering by the Window Manager.

    Which driver are you using?

    If you are using GUIDRV_Lin you can use multibuffering. If you use e.g. GUIDRV_FlexColor multibuffering is not available but you can set it up to a cache which hase more or less the same function than multiple buffers.

    You can simply create your own c-bitmaps with the BitmapConverter. If you are using an ST device you can use the BitmapConverter (BmpCvt.exe) which comes with the STM32Cube pakage.

    If not, you can download a demo version of the BitmapConvert from our website:
    segger.com/downloads/emwin/

    The demo version has the same functionality as the full version but shows a pop up at the beginning.

    Regards,
    Sven