日期:2014-05-17 浏览次数:20730 次
public partial class Form1 : Form
{
//定时器
System.Windows.Forms.Timer loop;
//图片集合
List<Bitmap> images;
//当前帧
int frame;
public Form1()
{
InitializeComponent();
//初始化图片集合
images = new List<Bitmap>();
images.Add(new Bitmap("Add.png"));
images.Add(new Bitmap("Attendance.png"));
images.Add(new Bitmap("Cancel.png"));
loop = new System.Windows.Forms.Timer();
//1秒刷新一次
loop.Interval = 1000;
loop.Tick += new EventHandler(loop_Tick);
loop.Start();
}
private void loop_Tick(object sender, EventArgs e)
{
//递增帧
pictureBox1.Image = images[(frame++) % images.Count];
}
}