【发布时间】:2012-07-09 07:30:04
【问题描述】:
我想在 bmp 图像上画一条线,该线将传递给使用 C# 中的 drawline 方法的方法
public void DrawLineInt(Bitmap bmp)
{
Pen blackPen = new Pen(Color.Black, 3);
int x1 = 100;
int y1 = 100;
int x2 = 500;
int y2 = 100;
// Draw line to screen.
e.Graphics.DrawLine(blackPen, x1, y1, x2, y2);
}
这给出了一个错误。所以我想知道如何在这里包含绘画事件 (PaintEventArgs e)
还想知道我们调用drawmethod时如何传递参数? 例子
DrawLineInt(Bitmap bmp);
这给出以下错误 “当前上下文中不存在名称‘e’”
【问题讨论】:
-
“这给出了一个错误”。什么错误?
标签: c# system.drawing