Table of Contents

Method Line

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Line(InputOutputArray, int, int, int, int, Scalar, int, LineTypes, int)

Draws a line segment connecting two points

public static void Line(InputOutputArray img, int pt1X, int pt1Y, int pt2X, int pt2Y, Scalar color, int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0)

Parameters

img InputOutputArray

The image.

pt1X int

First point's x-coordinate of the line segment.

pt1Y int

First point's y-coordinate of the line segment.

pt2X int

Second point's x-coordinate of the line segment.

pt2Y int

Second point's y-coordinate of the line segment.

color Scalar

Line color.

thickness int

Line thickness. [By default this is 1]

lineType LineTypes

Type of the line. [By default this is LineType.Link8]

shift int

Number of fractional bits in the point coordinates. [By default this is 0]

Line(InputOutputArray, Point, Point, Scalar, int, LineTypes, int)

Draws a line segment connecting two points

public static void Line(InputOutputArray img, Point pt1, Point pt2, Scalar color, int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0)

Parameters

img InputOutputArray

The image.

pt1 Point

First point of the line segment.

pt2 Point

Second point of the line segment.

color Scalar

Line color.

thickness int

Line thickness. [By default this is 1]

lineType LineTypes

Type of the line. [By default this is LineType.Link8]

shift int

Number of fractional bits in the point coordinates. [By default this is 0]