static Image * pImg = new Image(L"C:\\Users\\qianyuxiang\\Desktop\\my.gif");
UINT dn = pImg->GetFrameDimensionsCount(); // Image *pImg;
GUID * guids = new GUID[dn]; // delete guids;
pImg->GetFrameDimensionsList(guids, dn);
UINT fn = pImg->GetFrameCount(&guids[0]); // 帧数
if (fn < 2) { // res\Images资源目录中的globe.gif文件,是一个地球GIF动画文件
MessageBox(0,L"图像文件中未含多帧图片!",0,0);
return;
}
static UINT cf = 0;
pImg->SelectActiveFrame(guids, cf);
graph.DrawImage(pImg, 0, 0);
Sleep(1000);
cf++;
if(cf == fn-1)return;
cf %= fn;
用VC读取gif动画,并显示之
最新推荐文章于 2019-02-25 12:30:00 发布