-
using System;
-
using System.Collections.Generic;
-
using System.ComponentModel;
-
using System.Data;
-
using System.Drawing;
-
using System.Linq;
-
using System.Text;
-
using System.Windows.Forms;
-
-
namespace mou
-
{
-
public partial class Form1 : Form
-
{
-
Graphics FormCGI;
-
int Index = 0;
-
-
Image MyImage0 = Image.FromFile("E:\\Image\\0.jpg");
-
Image MyImage1 = Image.FromFile("E:\\Image\\1.jpg");
-
Image MyImage2 = Image.FromFile("E:\\Image\\2.jpg");
-
Image MyImage3 = Image.FromFile("E:\\Image\\3.jpg");
-
Image MyImage4 = Image.FromFile("E:\\Image\\4.jpg");
-
Image MyImage5 = Image.FromFile("E:\\Image\\5.jpg");
-
Image MyImage6 = Image.FromFile("E:\\Image\\6.jpg");
-
Image MyImage7 = Image.FromFile("E:\\Image\\7.jpg");
-
Image MyImage8 = Image.FromFile("E:\\Image\\8.jpg");
-
Image MyImage9 = Image.FromFile("E:\\Image\\9.jpg");
-
Image MyImage10 = Image.FromFile("E:\\Image\\10.jpg");
-
Image MyImage11 = Image.FromFile("E:\\Image\\11.jpg");
-
Image MyImage12 = Image.FromFile("E:\\Image\\12.jpg");
-
Image MyImage13 = Image.FromFile("E:\\Image\\13.jpg");
-
Image MyImage14 = Image.FromFile("E:\\Image\\14.jpg");
-
Image MyImage15 = Image.FromFile("E:\\Image\\15.jpg");
-
Image MyImage16 = Image.FromFile("E:\\Image\\16.jpg");
-
Image MyImage17 = Image.FromFile("E:\\Image\\17.jpg");
-
-
public Form1()
-
{
-
InitializeComponent();
-
FormCGI = this.CreateGraphics();
-
}
-
-
private void Form1_MouseClick(object sender, MouseEventArgs e)
-
{
-
FormCGI.Clear(Color.LightGray);
-
-
Rectangle MyRectangle = new Rectangle(e.X, e.Y, 200, 200); //起点是鼠标点击的位置
-
-
if(Index % 18 == 0)
-
FormCGI.DrawImage(MyImage0, MyRectangle);
-
else if (Index % 18 == 1)
-
FormCGI.DrawImage(MyImage1, MyRectangle);
-
else if (Index % 18 == 2)
-
FormCGI.DrawImage(MyImage2, MyRectangle);
-
else if (Index % 18 == 3)
-
FormCGI.DrawImage(MyImage3, MyRectangle);
-
else if (Index % 18 == 4)
-
FormCGI.DrawImage(MyImage4, MyRectangle);
-
else if (Index % 18 == 5)
-
FormCGI.DrawImage(MyImage5, MyRectangle);
-
else if (Index % 18 == 6)
-
FormCGI.DrawImage(MyImage6, MyRectangle);
-
else if (Index % 18 == 7)
-
FormCGI.DrawImage(MyImage7, MyRectangle);
-
else if (Index % 18 == 8)
-
FormCGI.DrawImage(MyImage8, MyRectangle);
-
else if (Index % 18 == 9)
-
FormCGI.DrawImage(MyImage9, MyRectangle);
-
else if (Index % 18 == 10)
-
FormCGI.DrawImage(MyImage10, MyRectangle);
-
else if (Index % 18 == 11)
-
FormCGI.DrawImage(MyImage11, MyRectangle);
-
else if (Index % 18 == 12)
-
FormCGI.DrawImage(MyImage12, MyRectangle);
-
else if (Index % 18 == 13)
-
FormCGI.DrawImage(MyImage13, MyRectangle);
-
else if (Index % 18 == 14)
-
FormCGI.DrawImage(MyImage14, MyRectangle);
-
else if (Index % 18 == 15)
-
FormCGI.DrawImage(MyImage15, MyRectangle);
-
else if (Index % 18 == 16)
-
FormCGI.DrawImage(MyImage16, MyRectangle);
-
else
-
FormCGI.DrawImage(MyImage17, MyRectangle);
-
-
Index++;
-
}
-
-
private void timer1_Tick(object sender, EventArgs e)
-
{
-
FormCGI.Clear(Color.LightGray);
-
-
Rectangle MyRectangle = new Rectangle(100, 100, 300, 300); //起点是鼠标点击的位置
-
-
if (Index % 18 == 0)
-
FormCGI.DrawImage(MyImage0, MyRectangle);
-
else if (Index % 18 == 1)
-
FormCGI.DrawImage(MyImage1, MyRectangle);
-
else if (Index % 18 == 2)
-
FormCGI.DrawImage(MyImage2, MyRectangle);
-
else if (Index % 18 == 3)
-
FormCGI.DrawImage(MyImage3, MyRectangle);
-
else if (Index % 18 == 4)
-
FormCGI.DrawImage(MyImage4, MyRectangle);
-
else if (Index % 18 == 5)
-
FormCGI.DrawImage(MyImage5, MyRectangle);
-
else if (Index % 18 == 6)
-
FormCGI.DrawImage(MyImage6, MyRectangle);
-
else if (Index % 18 == 7)
-
FormCGI.DrawImage(MyImage7, MyRectangle);
-
else if (Index % 18 == 8)
-
FormCGI.DrawImage(MyImage8, MyRectangle);
-
else if (Index % 18 == 9)
-
FormCGI.DrawImage(MyImage9, MyRectangle);
-
else if (Index % 18 == 10)
-
FormCGI.DrawImage(MyImage10, MyRectangle);
-
else if (Index % 18 == 11)
-
FormCGI.DrawImage(MyImage11, MyRectangle);
-
else if (Index % 18 == 12)
-
FormCGI.DrawImage(MyImage12, MyRectangle);
-
else if (Index % 18 == 13)
-
FormCGI.DrawImage(MyImage13, MyRectangle);
-
else if (Index % 18 == 14)
-
FormCGI.DrawImage(MyImage14, MyRectangle);
-
else if (Index % 18 == 15)
-
FormCGI.DrawImage(MyImage15, MyRectangle);
-
else if (Index % 18 == 16)
-
FormCGI.DrawImage(MyImage16, MyRectangle);
-
else
-
FormCGI.DrawImage(MyImage17, MyRectangle);
-
-
Index++;
-
}
-
-
private void PlayButton_Click(object sender, EventArgs e)
-
{
-
if (timer1.Enabled == true)
-
{
-
timer1.Enabled = false;
-
PlayButton.Text = "播放";
-
}
-
-
else
-
{
-
timer1.Enabled = true;
-
PlayButton.Text = "暂停";
-
}
-
}
-
}
-
}
阅读(1782) | 评论(0) | 转发(1) |