如何在静态控件中显示动画GIF图像? [英] How to display an animated GIF image in a static control?
本文介绍了如何在静态控件中显示动画GIF图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在静态控件中显示没有动画的位图图像。
I can display a bitmap image without animation in a static control.
如何在静态控件中显示带动画的GIF图像? GIF图像在下面的代码中加载了GDI +,但只显示了GIF第一帧的静态图像,没有动画。如何在GIF中显示动画?
$
How to display a GIF image with animation in a static control? The GIF image is loaded with GDI+ in the code below, but only a static image of the first frame of the GIF is displayed, there is no animation. How to display the animation in GIF?
HBITMAP ctrlBitmap(NULL);
Gdiplus::Bitmap* pBitmap = NULL;
pBitmap = new Gdiplus::Bitmap(pStream);
pBitmap->GetHBITMAP(NULL, &ctrlBitmap);
CStatic m_ctrlImage;
m_ctrlImage.Create(NULL, WS_CHILD | SS_BITMAP | WS_VISIBLE | SS_REALSIZEIMAGE | SS_CENTERIMAGE | WS_BORDER, rectImage, this, IDC_IMAGE);
::SendMessage(m_ctrlImage, STM_SETIMAGE, IMAGE_BITMAP,(LPARAM)(HBITMAP)ctrlBitmap);
提前付款。
Thanks in advance.
推荐答案
你看过这个吗?
Did you check this?
https://www.codeproject.com/articles/4260/gif-animation-control
-Seetharam
>
这篇关于如何在静态控件中显示动画GIF图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文