c# 鼠标画图如何加入重绘函数
System.Drawing.Graphics MyGraphic;
private void Form1_Load(object sender, EventArgs e)
{
MyGraphic = pictureBox2.CreateGraphics();
}
private void pictureBox2_MouseClick(object sender, MouseEventArgs e)
{
MyGraphic.DrawLine(Pens.Red, e.X + 10, e.Y, e.X - 10, e.Y);
MyGraphic.DrawLine(Pens.Red, e.X, e.Y + 10, e.X, e.Y - 10);
}
我用picturebox2加载图片,然后在MyGraphic上画图,如何使重绘后,我所画的图和picturebox2加载的图都在,应该是将MyGraphic保存,在绘画,请问大家是如何实现的,谢谢
------解决方案--------------------