由一个原picturebox动态创建的多个picturebox,动态创建的picturebox用的原picturebox的图片。旋转其中一个picturebix的图片,其余的跟着选择。这可咋整,能只旋转其中一个么
可以:基本思路是用Bitmap保存一个图片 让所有picturebox.Image = Bitmap里的图片,
不管您旋转那个图片最终修改的都是Bitmap原图,然后刷新显示即可。
参考源码:
Bitmap bmp = new Bitmap("1.png");
private void button1_Click(object sender, EventArgs e)
{
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
this.MainShow();
}
private void MainShow()
{
pictureBox1.Image = bmp;
pictureBox2.Image = bmp;
pictureBox3.Image = bmp;
pictureBox4.Image = bmp;
pictureBox5.Image = bmp;
pictureBox6.Image = bmp;
pictureBox7.Image = bmp;
}