System::Drawing::Graphics::DrawLine 方法

Graphics::DrawLine(const SharedPtr<Pen>&, float, float, float, float) method

使用指定的笔绘制指定的直线。

void System::Drawing::Graphics::DrawLine(const SharedPtr<Pen> &pen, float x1, float y1, float x2, float y2)
ParameterType描述
penconst SharedPtr<Pen>&一个 Pen 对象,指定要绘制的线条的图形属性
x1单精度浮点数定义要绘制的线条的第一个点的 X 坐标
y1单精度浮点数定义要绘制的线条的第一个点的 Y 坐标
x2单精度浮点数定义要绘制的线条的第二个点的 X 坐标
y2单精度浮点数绘制线段时定义的第二个点的 Y 坐标

另见

Graphics::DrawLine(const SharedPtr<Pen>&, int, int, int, int) method

使用指定的笔绘制指定的直线。

void System::Drawing::Graphics::DrawLine(const SharedPtr<Pen> &pen, int x1, int y1, int x2, int y2)
ParameterType描述
penconst SharedPtr<Pen>&一个 Pen 对象,指定要绘制的线条的图形属性
x1int定义要绘制的线条的第一个点的 X 坐标
y1int定义要绘制的线条的第一个点的 Y 坐标
x2int定义要绘制的线条的第二个点的 X 坐标
y2int绘制线段时定义的第二个点的 Y 坐标

另见

Graphics::DrawLine(const SharedPtr<Pen>&, Point, Point) method

使用指定的笔绘制指定的直线。

void System::Drawing::Graphics::DrawLine(const SharedPtr<Pen> &pen, Point pt1, Point pt2)
ParameterType描述
penconst SharedPtr<Pen>&一个 Pen 对象,指定要绘制的线条的图形属性
pt1Point绘制线段时定义的第一个点
pt2Point绘制线段时定义的第二个点

另见

Graphics::DrawLine(const SharedPtr<Pen>&, PointF, PointF) method

使用指定的笔绘制指定的直线。

void System::Drawing::Graphics::DrawLine(const SharedPtr<Pen> &pen, PointF pt1, PointF pt2)
ParameterType描述
penconst SharedPtr<Pen>&一个 Pen 对象,指定要绘制的线条的图形属性
pt1PointF绘制线段时定义的第一个点
pt2PointF绘制线段时定义的第二个点

另见