写一个winform picturebox1 图像拷贝到picturebox2的实例
时间: 2023-05-17 21:04:21 浏览: 89
winform只运行一个实例
可以使用以下代码实现:
private void button1_Click(object sender, EventArgs e)
{
// 将picturebox1中的图像拷贝到picturebox2中
Graphics g = pictureBox2.CreateGraphics();
g.DrawImage(pictureBox1.Image, new Rectangle(0, 0, pictureBox2.Width, pictureBox2.Height));
}
阅读全文