绘制gif文件
来源:互联网 发布:js radio value 编辑:程序博客网 时间:2024/05/23 18:06
using System;
using System.Drawing;
using System.Windows.Forms;
public class animateImage : Form
{
//Create a Bitmpap Object.
Bitmap animatedImage = new Bitmap("SampleAnimation.gif");
bool currentlyAnimating = false;
//This method begins the animation.
public void AnimateImage()
{
if (!currentlyAnimating)
{
//Begin the animation only once.
ImageAnimator.Animate(animatedImage, new EventHandler(this.OnFrameChanged));
currentlyAnimating = true;
}
}
private void OnFrameChanged(object o, EventArgs e)
{
//Force a call to the Paint event handler.
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
//Begin the animation.
AnimateImage();
//Get the next frame ready for rendering.
ImageAnimator.UpdateFrames();
//Draw the next frame in the animation.
e.Graphics.DrawImage(this.animatedImage, new Point(0, 0));
}
public static void Main()
{
Application.Run(new animateImage());
}
}
这里要注意一点:
bitmap一定要放在Paint事件外面 ,否则就重复画一帧;
- 绘制gif文件
- Excel VBA循环绘制GIF图片到文件
- 绘制GIF图片闪烁问题!
- 如何在symbian下绘制Gif图像
- C# ImageAnimator 绘制GIF偶尔红叉
- .NET显示gif文件
- GIF文件编码【转贴】
- 解读GIF文件
- GIF文件分析
- Delphi 读取 GIF 文件
- gif文件头欺骗
- 文件格式解析:GIF文件
- gif文件导出png
- android gif文件读取
- matlab gif文件生成
- 保存gif文件.m
- GIF文件存储结构
- VC播放GIF文件
- base_convert() PHP 函数
- Javascript图表库: Dojo Charting
- pack() PHP 函数
- java获取文件路径
- SQL SERVER中一些常见性能问题的总结
- 绘制gif文件
- 关于背景图片固定 不会随着页面滚动而变化,及定位注意问题
- SQL的随机抽取
- C#创建数字证书并导出为pfx,并使用pfx进行非对称加解密
- 一个唱片商店的小例子 可以自动旋转唱片 点击弹出唱片
- 一个支持多线程的内存池
- 利用mysql的inet_aton()和inet_ntoa()函数存储IP地址
- VBScript 中 数值相减计算方法
- APIDEMO PROGRESS BAR