简单的帮你做了一下向下走,其他的稍微改改就行了
在窗体上放两个pictureBox,一个button,pictureBox1放原图pictureBox2显示当前的走路的姿势button1表示向下走
Rectangle rec = new Rectangle(0, 0, 32, 48);
Size addDown = new Size(32, 0);//向下走
Bitmap sorcse;
Bitmap bit;
private void Form1_Load(object sender, EventArgs e)
{
sorcse = new Bitmap(pictureBox1.Image);
}
private void button1_Click(object sender, EventArgs e)
{
bit = sorcse.Clone(rec, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
if (rec.Location.X < 96)
{
rec.Location += addDown;
}
else
{
rec.Location = new Point(0, 0);
}
pictureBox2.Image = bit;
}
温馨提示:答案为网友推荐,仅供参考