我有PictureBox
与Image
,我用的是Paint
事件在其上画一条线,但是当我保存图像,我得到没有线被画保存图像绘制之后
private void PicBox_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(pen, end, start);
e.Graphics.Flush();
e.Graphics.Save();
}
//and I save it like this
picBox.Image.Save("directory");
图像
这里错过了什么?
是行画过它的程序? – kevin628
@ kevin628你是什么意思?是的,它是绘制的,我可以看到它,但是当我保存它只是没有线的图像... – Abanoub
添加到@空闲的(几乎正确)的答案:既不'e.Graphics.Flush()'也没有'e.Graphics。保存()'应该在那里!你也许不会这么想。 – TaW