Graphics DrawLine
Pen p = new Pen(Color.Red, 1);
Point p1=...;
Point p2=...;
Graphics gr;
gr.DrawLine(p,p1,p2);
为什么总提示:使用了未赋值的局部变量“gr”
我用了gr=this.CreateGraphics();
但会要求创建:
private Graphics CreateGraphics()
{
throw new Exception("The method or operation is not implemented.");
}
难道因为我重写了redraw?
我现在就想画这个线,怎么画?