MemDev, flickering GIF images

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

  • MemDev, flickering GIF images

    Hello,

    I created a simple dialog consisting of 2 button widgets, some image widgets (with a gif) and a text widget.

    Pushing buttons changes the value of the Text widget. However, in some cases this lead to flickering.

    Adding:

    Source Code

    1. #if GUI_SUPPORT_MEMDEV
    2. WM_SetCreateFlags(WM_CF_MEMDEV);
    3. WM_EnableMemdev(WM_HBKWIN);
    4. #endif



    solved the flickering issue, however, now the gifs won't show up.

    If I change the gifs to BMP's they do show up (in guibuilder ->assign BMP instead of gif).

    Any tips? I'd prefer GIF's for easy transparancy!

    Thanks.

    Steven

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

  • Hello Adrian,

    I've included my main file and the window created by the gui builder. I've also taken 2 pictures: 1 with WM_EnableMemdev(WM_HBKWIN) and one without WM_EnableMemdev(WM_HBKWIN).


    C Source Code

    1. /* Includes ------------------------------------------------------------------*/
    2. SNIP
    3. /* USER CODE BEGIN Includes */
    4. SNIP
    5. // includes for GUI
    6. #include "GUI.h"
    7. #include "DIALOG.h"
    8. #include "BUTTON.h"
    9. #include "WM.h"
    10. GUI_PID_STATE TS_State; // touch screen state
    11. WM_HWIN hwin_home_scr; // window handle home screen
    12. WM_HWIN hwin_status_bar; // window handle status screen
    13. WM_HWIN hwin_side_menu; // window handle side menu screen
    14. WM_HTIMER hTimerHome; // handle to timer on home screen
    15. /* USER CODE BEGIN PFP */
    16. extern WM_HWIN CreateWndSplash(void);
    17. extern WM_HWIN CreateWndStatusBar(void);
    18. extern WM_HWIN CreateWndHome(void);
    19. extern WM_HWIN CreateWndSideMenu(void);
    20. void show_splash(void);
    21. void update_touch(void);
    22. static void time_outs(void);
    23. int main(void)
    24. {
    25. Debug_ITMDebugEnable();
    26. HAL_Init();
    27. SystemClock_Config();
    28. MX_GPIO_Init();
    29. MX_ADC1_Init();
    30. MX_CRC_Init();
    31. MX_FSMC_Init();
    32. MX_I2C1_Init();
    33. MX_RTC_Init();
    34. MX_TIM9_Init();
    35. __CRC_CLK_ENABLE(); // need this for STemWin
    36. TFT_reset(); // reset TFT
    37. FT6206_begin(0); // reset touch panel
    38. GUI_Init(); // init GUI and set default skin
    39. #if GUI_SUPPORT_MEMDEV
    40. WM_SetCreateFlags(WM_CF_MEMDEV);
    41. WM_EnableMemdev(WM_HBKWIN);
    42. #endif
    43. GUI_EnableAlpha(1); // enable alpha blending
    44. show_splash();
    45. hwin_status_bar = CreateWndStatusBar();
    46. WM_ShowWindow(hwin_status_bar); // display window
    47. hwin_home_scr = CreateWndHome();
    48. WM_ShowWindow(hwin_home_scr); // display window
    49. hTimerHome = WM_CreateTimer(hwin_home_scr, 0, 1000, 0);
    50. while (1) {
    51. if (tstat_flags & (1 << TIMESTAMP_SEC)) {
    52. tstat_flags &= ~(1 << TIMESTAMP_SEC);
    53. time_outs();
    54. }
    55. update_touch();
    56. GUI_Exec();
    57. __WFI();
    58. }
    59. }
    Display All



    If you wish I can send the complete code, it's not closed source.

    Best regards & thanks for any tips.

    Steven
    Images
    • with_memdev.jpg

      61.5 kB, 480×640, viewed 842 times
    • without memdev.jpg

      72.22 kB, 480×640, viewed 853 times
    Files
    • WndHomeDLG.txt

      (26.54 kB, downloaded 775 times, last: )
  • Hello Steven,

    Thank you for sending the code. Unfortunately I am not able to compile. Would it be possible for you to provide me with the least required code which shows the problem and enables me to run in the the emWin simulation environment? Thank you.

    Best regards,
    Adrian
  • Hello Adrian,

    I've tried duplicating this behavior in the simulator, but everything works fine in the simulator, but not on the target hardware.

    I've attached the code that I used to test on the simulator, and also a movie of what happens on target hardware.
    ProblemReport.zip



    IMG_2147_MOVIE.zip

    Source Code

    1. void MainTask(void) {
    2. WM_HWIN WndSplash;
    3. PROGBAR_Handle PbarProgress;
    4. unsigned char i;
    5. GUI_Init();
    6. WndSplash = CreateWindow();
    7. WM_ShowWindow(WndSplash); // display window
    8. for (i = 0; i < 101; i++) {
    9. PbarProgress = WM_GetDialogItem(WndSplash, ID_PROGBAR_0);
    10. PROGBAR_SetValue(PbarProgress, i);
    11. GUI_Exec();
    12. GUI_Delay(5);
    13. }
    14. WM_DeleteWindow(WndSplash);
    15. WM_SelectWindow(WM_HBKWIN);
    16. GUI_Clear();
    17. GUI_DispString("With WM_CF_MEMDEV");
    18. GUI_Delay(500);
    19. WM_SetCreateFlags(WM_CF_MEMDEV);
    20. WM_EnableMemdev(WM_HBKWIN);
    21. WndSplash = CreateWindow();
    22. WM_ShowWindow(WndSplash); // display window
    23. for (i = 0; i < 101; i++) {
    24. PbarProgress = WM_GetDialogItem(WndSplash, ID_PROGBAR_0);
    25. PROGBAR_SetValue(PbarProgress, i);
    26. GUI_Exec();
    27. GUI_Delay(5);
    28. }
    29. while (1); /* Make sure program does not terminate */
    30. }
    Display All


    I've allocated 64 kBytes of memory so I'm fairly certain that should be sufficient for a 300 X 50 pixel GIF.

    Change the gif to a bitmap and everything works ?) Using STemwin 5.26

    Tips are welcome :)

    Steven