Graphics g;
Bitmap bmp;
int dx = 10;
int dy = 5;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
g = Graphics.FromImage(bmp);
g.FillRectangle(new SolidBrush(Color.Aqua), 0, 0, pictureBox1.Width, 200);
SolidBrush b = new SolidBrush(Color.Coral);
g.FillEllipse(b, 50+dx, 50+dy, 40, 40);
dx += 10;
dy += 5;
g.FillRectangle(new SolidBrush(Color.DarkSlateBlue),0,180,pictureBox1.Width, 200);
g.FillRectangle(new SolidBrush(Color.Blue),0,200, pictureBox1.Width, pictureBox1.Height);
pictureBox1.Image = bmp;
}