请教,如何可以实现图片的连续移动??
想法是这样的,在窗体中拉入一个pictureBox,接上图片,当我按上,下,左,右键的时候,它会做相应移动,代码如下:private void Form1_KeyDown(object sender, KeyEventArgs e)
{
int x = pictureBox1.Location.X;
int y=pictureBox1.Location.Y;
if (e.KeyCode == Keys.Up)
{
pictureBox1.Location = new Point(x, y-2);
}
if (e.KeyCode == Keys.Down)
{
pictureBox1.Location = new Point(x, y + 2);
}
if (e.KeyCode == Keys.Left)
{
pictureBox1.Location = new Point(x-2, y);
}
if (e.KeyCode == Keys.Right)
{
pictureBox1.Location = new Point(x + 2, y);
}
}
但是当图片移动时是非常不连贯的,想请问一下大家,有没有办法让图片移动得好看呢?你们会用什么方法实现呢?谢谢!