网上找个很久关于Mobile6.5播放动态gif的资料,大部分资料都是以下废话。。。
1. 使用WebBrowser控件
2. 使用微软为Wince补充的AnimationControl控件
3. 使用网络上流传的ImageCtrl.dll
4. 仿照Win32代码用C#解码GIF播放
发现1不好,因为还得请求一次链接。
webBrowser.Url =new System.Uri("gif文件");
webBrowser是工具箱中的控件,拖过来就能用。
ImageCtrl.dll 大部分都是C++写的,对于我这种入门级C#菜鸟而言,引用并不好,改写为C#版本后,发现能支持特定gif,自己做的gif有部分不行,不知道啥原因。
最后硬着头皮用微软的AnimationControl控件,代码如下:
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;
namespace AnimateControl
{
public enum FrameLayouts
{
Horisontal = 0,
Vertical = 1
}
/// <summary>
/// Summary description for AnimateCtl.
/// </summary>
public class Animate