lpcware

Drawing animated GIF

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by an.skornyakov on Thu Aug 09 04:25:41 MST 2012
I'm trying to show animated gif file on my device. Image buffer placed in SDRAM. MEMDEV is used for displaying GIF. Animation displayed, but with huge distortions. There are sample in images attached. Originally, that was Bart Simpsons.

code:
   hMem = GUI_MEMDEV_Create(XPos, YPos, GifInfo.xSize, GifInfo.ySize);
   GUI_MEMDEV_Select(hMem);
                      
   for (j = 0; j < GifInfo.NumImages; j++){
      GUI_MEMDEV_Clear(hMem);
      GUI_ClearRect(XPos, YPos, GifInfo.xSize, GifInfo.ySize);
      GUI_GIF_DrawSub(_aImgBuffer, fStat.st_size, XPos, YPos, j);
      GUI_MEMDEV_CopyToLCD(hMem);
      GUI_GIF_GetImageInfo(_aImgBuffer, fStat.st_size, &ImageInfo, j);      
      GUI_Delay(ImageInfo.Delay ? ImageInfo.Delay * 5 : 100);   
   }
                                           
   GUI_MEMDEV_Delete(hMem);

Outcomes