Load a gif file : Gif « 2D « C# / CSharp Tutorial






Load a gif file
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class BitmapLoading : System.Windows.Forms.Form
{
  public BitmapLoading()
  {
    this.BackColor = System.Drawing.Color.White;
    this.ClientSize = new System.Drawing.Size(400, 400);
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.BitmapLoading_Paint);
  }

  static void Main() 
  {
    Application.Run(new BitmapLoading());
  }

  private void BitmapLoading_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  {
    Graphics g = e.Graphics;
    Bitmap b = new Bitmap("YourFile.gif");
    g.DrawImage(b, 10, 10, 350, 300);
  }
}








27.21.Gif
27.21.1.Load a gif fileLoad a gif file