update : DEOM download from here


想用GDI+生成动画式的Gif图片示例代码:
GDI+生成动画式的Gif图片示例代码Bitmap bmp = new Bitmap(100, 100);
GDI+生成动画式的Gif图片示例代码
Graphics g = Graphics.FromImage(bmp);
GDI+生成动画式的Gif图片示例代码
Font f = new Font("arial", 11f);
GDI+生成动画式的Gif图片示例代码
Brush b = Brushes.Blue;
GDI+生成动画式的Gif图片示例代码
GDI+生成动画式的Gif图片示例代码string txt = "Rotate text animation!";
GDI+生成动画式的Gif图片示例代码
SizeF sz = g.MeasureString(txt, f);
GDI+生成动画式的Gif图片示例代码
g.Clear(Color.WhiteSmoke);
GDI+生成动画式的Gif图片示例代码
g.DrawString(txt, f, b, 50-sz.Width/2, 50-sz.Height/2);
GDI+生成动画式的Gif图片示例代码
g.Flush();
GDI+生成动画式的Gif图片示例代码//(The following code create a starting frame from bmp)
GDI+生成动画式的Gif图片示例代码
GifImage.GifAnimation gif = new GifImage.GifAnimation(bmp, 
GDI+生成动画式的Gif图片示例代码
    GifImage.GraphicControlExt.Default);
GDI+生成动画式的Gif图片示例代码//(Set this property otherwise the animation will not play circularly)
GDI+生成动画式的Gif图片示例代码
gif.Application = GifImage.ApplicationExt.Default;
GDI+生成动画式的Gif图片示例代码//(Use global color table only, set this option will greatly decrease the size of output file)
GDI+生成动画式的Gif图片示例代码
gif.UseGlobalColorTableOnly = true;
GDI+生成动画式的Gif图片示例代码
GDI+生成动画式的Gif图片示例代码for (int i = 1; i < 36; ++i)
fs.Close;

相关文章: