GUI_GIF_DrawSub(). Drawing animated GIF.

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

  • GUI_GIF_DrawSub(). Drawing animated GIF.

    Hello,
    I have a problem drawing animated GIF using GUI_GIF_DrawSub(). I'm loading GIF file via Ethernet to device and store it in Nand-flash + file system (UFFS). Then I load whole animated GIF file from NAND to buffer in SDRAM and try to show it using GUI_GIF_DrawSub():

    C Source Code

    1. GUI_ClearRect(0, 0, 800, 480);
    2. GUI_GIF_GetInfo(_aImgBuffer, fStat.st_size, &GifInfo); // aImgBuffer - buffer for animated GIF file in SDRAM
    3. XPos = (GifInfo.xSize > 320) ? 0 : 160 - (GifInfo.xSize / 2);
    4. YPos = (GifInfo.ySize > 180) ? 60 : 150 - (GifInfo.ySize / 2);
    5. XPos = 400 - GifInfo.xSize/2;
    6. YPos = 240 - GifInfo.ySize/2;
    7. for (j = 0; j < GifInfo.NumImages; j++) {
    8. GUI_MULTIBUF_Begin();
    9. GUI_Clear();GUI_GIF_DrawSub(_aImgBuffer, fStat.st_size, XPos, YPos, j);
    10. GUI_MULTIBUF_End();
    11. GUI_GIF_GetImageInfo(_aImgBuffer2, fStat.st_size, &ImageInfo, j);
    12. GUI_Delay(ImageInfo.Delay ? ImageInfo.Delay * 10 :100);
    13. }
    Display All

    In fact, animation is really displayed, but often with huge distortion on it (example is in the end of topic).
    All buffers for LCD and emWin are placed in SDRAM, SDRAM and NANd-flash drived via EMC, device is based on NXP LPC1788 microcontoller.
    Does anybody know, what can be a reason?
    Thanks.
    [img]http://www.lpcware.com/sites/default/files/images/CSC_0859.JPG[/img]
    [img]http://www.lpcware.com/sites/default/files/images/CSC_0860.JPG[/img]