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?
我现在就想画这个线,怎么画?
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?
我现在就想画这个线,怎么画?
...全文
相关推荐
VB2005Drawline
本程序使用VisualStudio 2005制作, 使用VisualBasic 2005程序语言编写. 运行实例及源码需安装.netframework 2.0.
c# 使用Graphics画线实例
c# 画线实例 Graphics入门实用的例子
使用Java的Graphics类进行绘图的方法详解
主要介绍了使用Java的Graphics类进行绘图的方法,是Java的GUI编程的基础,需要的朋友可以参考下
超详细的Graphics类学习笔记
详细讲解Graphics,结合实例解说
C#自动打印+Graphics自动画表格填变量+ ZXing产生
采用C#代码,利用Graphics类库自动画表格填充变量值,以及ZXing类库产生条码,最终打印出来



