Issue with GUI_MEMDEV_FadeInWindow again

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

  • Issue with GUI_MEMDEV_FadeInWindow again

    Hello all,

    Recent days, I worked with GUI_MEMDEV_FadeInWindow() & GUI_MEMDEV_FadeOutWindow() and ran into some issues.

    There are also some threads about them, like this:
    Issue with GUI_MEMDEV_FadeInWindow

    I used the codes in that page, everything worked very well.

    Then I used this in my project, and did the try as following steps:

    1) A toolbar to slide down (operate in one task):

    C Source Code

    1. static void _SlideDown (WM_HWIN hObj, U32 dy) {
    2. int Count, Time;
    3. for (Count = ((dy + 3) >> 2) - 1; Count >= 0; Count--) {
    4. Time = GUI_GetTime ();
    5. if (Count == 0) {
    6. WM_MoveWindow (hObj, 0, dy);
    7. } else {
    8. WM_MoveWindow (hObj, 0, 4);
    9. dy -= 4;
    10. }
    11. GUI_Delay (15 - (GUI_GetTime() - Time));
    12. }
    13. }
    Display All


    2) A text to fade in & fade out (operate in another task):

    C Source Code

    1. _hTextFading = TEXT_CreateEx (50, 100, 150, 30, WM_GetClientWindow (hWin),
    2. 0x0, 0x0, 0x880, "Message Fading");
    3. TEXT_SetFont (_hTextFading, GUI_FONT_20F_ASCII);
    4. TEXT_SetTextAlign (_hTextFading, GUI_TA_HCENTER | GUI_TA_VCENTER);
    5. TEXT_SetTextColor (_hTextFading, GUI_WHITE);
    6. WM_SetHasTrans (_hTextFading);
    7. WM_SetStayOnTop (_hTextFading, ON);


    C Source Code

    1. do {
    2. int counter = 0;
    3. WM_GetWindowRectEx (_hTextFading, &rect);
    4. while (counter < 5) {
    5. GUI_MEMDEV_FadeInWindow (_hTextFading, 5000);
    6. WM_InvalidateArea (&rect);
    7. GUI_Delay (1000);
    8. GUI_MEMDEV_FadeOutWindow (_hTextFading, 5000);
    9. WM_InvalidateArea (&rect);
    10. GUI_Delay (1000);
    11. counter++;
    12. }
    13. } while (0);
    Display All


    3) Let the text fade in & out, then there's a black rectangle during the process.

    4) If let the toolbar slide down while the text fading in & out, then the toolbar may be frozen.

    You can get the details from the attachment as:



    The questions are:
    1) How to deal with the black rectangle?
    2) Why does GUI_MEMDEV_FadeInWindow() / GUI_MEMDEV_FadeOutWindow() cause frozen?

    I use emWin with FreeRTOS, using multi-task support:
    1) multi-task will call emWin
    2) one background task call GUI_Exec() with the interval of 1ms
    3) there will be a 'live' image view behind text and its content always changing

    Any advice or idea?

    Thanks,
    Kenmux

    The post was edited 1 time, last by kenmux ().