|
static void _ShowMovie(const char* pFile, int FileSize) {
GUI_GIF_IMAGE_INFO ImageInfo = { 0 }; // Info structure of one particular GIF image of the GIF file
GUI_GIF_INFO GifInfo = { 0 }; // Info structure of GIF file
int i;
int j;
int XPos;
int YPos;
//
// Display sample information
//
GUI_SetFont(&GUI_Font8x16);
GUI_ClearRect(0, 40, 319, 59);
GUI_DispStringHCenterAt("Show complete GIF file as movie", 160, 40);
//
// Show movie
//
GUI_ClearRect(0, 60, 320, 320); // Clear the image area
GUI_GIF_GetInfo(pFile, FileSize, &GifInfo); // Get GIF info structure
XPos = (GifInfo.xSize > 320) ? 0 : 160 - (GifInfo.xSize / 2);
YPos = (GifInfo.ySize > 180) ? 60 : 150 - (GifInfo.ySize / 2);
for (i = 0; i < 2; i++) { // Show the complete GIF 2 times ...
for (j = 0; j < GifInfo.NumImages; j++) {
GUI_GIF_DrawSub(pFile, FileSize, XPos, YPos, j); // Draw sub image
GUI_GIF_GetImageInfo(pFile, FileSize, &ImageInfo, j); // Get sub image information
GUI_Delay(ImageInfo.Delay ? ImageInfo.Delay * 10 : 100); // Use the Delay member of the ImageInfo structure for waiting a while
}
GUI_Delay(200); // Wait a while
}
}
我尝试上面的函数可以将动图的C数组显示在背景界面,但是没办法绘制在窗口(因为WM_PAINT不能绘制阻塞类的函数,只能是显示文本,数字,图片之类的)。我尝试用定时器去定时切换帧,然后刷新 GUI_GIF_DrawSub,没有效果 |
|