使用Timer组件实现人物动画效果

实现效果:

  

知识运用:

  Graphics类的DrawImage方法    //在指定位置 按原始大小绘制指定的Image对象

  public void DrawImage(Image image,Point point)

实现代码:

        private void timer1_Tick(object sender, EventArgs e)
        {
            CreateGraphics().DrawImage(Image.FromFile(
                (index++>8?(index=1):index).ToString()+".bmp"),new Point(0,0));
        }

猜你喜欢

转载自www.cnblogs.com/feiyucha/p/10188239.html
今日推荐