Image GIF Drawing

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

    • Image GIF Drawing


      I have a program where i have to display a GIF file on the screen. I am using Image widget to display the GIF.
      If i use the PC simulation the GIF is displayed correctly and i am able to see the animation.

      But when i run the same code on my hardware (iMXRT1064) i see only the first image displayed on the screen. I don't see any animation. What could be the problem?
      I am using color mode as 16bpp. I have allocated as #define GUI_NUMBYTES 1500000U

      I probably think a time base is required for the GIF files to run on hardware. how can i provide the same in my code. Am not using RTOS.




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

    • Hi,

      the easiest way to display animated GIFs on a target is by using GUI_SPRITE_CreateAnim(). I've attached a sample that demonstrates this.

      You need to convert the GIF into an animated sprite beforehand. This is done by selecting "File -> Create animated sprite from GIF" and saving the file.

      Best regards,

    • Hello,

      I am facing an issue while displaying the GIF files. It is observed that animation is slow for GIF files.

      for the emwin time base i have created a hardware systic timer of 1ms. Incremented g_millisecCounter on 1 ms systic timer interrupt an used the g_millisecCounter counter as below.

      GUI_TIMER_TIME GUI_X_GetTime(void)
      return g_millisecCounter;

      This displays the GIF correctly and am able to see animation but the animation is slow.

      I debugged and found out WM_PAINT is continuously called for the screen on which the GIF's are present. Using Image_setGIF for displaying GIF's. Used Bin2C for converting the GIF to .c files.

      If i do any other operations on widgets or ex i have a knob widget and if i use Knob_SetPostion which is called from a function in while loop
      the GIF's animations stop for a sec and then again continue. I call Knob_SetPostion every 500 msec.

      Even If i use Animated sprites for GIF i see the same result.




      The post was edited 2 times, last by anuj.tanksali ().