[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.GcGraphics.DrawLine

DrawLine Method

DrawLine(float, float, float, float, Color, float, DashStyle)

Draws a line between two points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the line is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawLine(float x1, float y1, float x2, float y2, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)
Public Sub DrawLine(x1 As Single, y1 As Single, x2 As Single, y2 As Single, lineColor As Color, lineWidth As Single, Optional lineStyle As DashStyle = DashStyle.Solid)
Parameters
Type Name Description
float x1

The X coordinate of the first point.

float y1

The Y coordinate of the first point.

float x2

The X coordinate of the second point.

float y2

The Y coordinate of the second point.

Color lineColor

The line color.

float lineWidth

The line width.

DashStyle lineStyle

The line style (solid by default).

DrawLine(float, float, float, float, Color, float, float[])

Draws a line between two points, using the specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the line is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawLine(float x1, float y1, float x2, float y2, Color lineColor, float lineWidth, float[] dashPattern)
Public Sub DrawLine(x1 As Single, y1 As Single, x2 As Single, y2 As Single, lineColor As Color, lineWidth As Single, dashPattern As Single())
Parameters
Type Name Description
float x1

The X coordinate of the first point.

float y1

The Y coordinate of the first point.

float x2

The X coordinate of the second point.

float y2

The Y coordinate of the second point.

Color lineColor

The line color.

float lineWidth

The line width.

float[] dashPattern

The dash pattern.

DrawLine(PointF, PointF, Color, float, DashStyle)

Draws a line between two points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the line is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawLine(PointF p1, PointF p2, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)
Public Sub DrawLine(p1 As PointF, p2 As PointF, lineColor As Color, lineWidth As Single, Optional lineStyle As DashStyle = DashStyle.Solid)
Parameters
Type Name Description
PointF p1

The first point.

PointF p2

The second point.

Color lineColor

The line color.

float lineWidth

The line width.

DashStyle lineStyle

The line style (solid by default).

DrawLine(PointF, PointF, Color, float, float[])

Draws a line between two points, using the specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the line is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawLine(PointF p1, PointF p2, Color lineColor, float lineWidth, float[] dashPattern)
Public Sub DrawLine(p1 As PointF, p2 As PointF, lineColor As Color, lineWidth As Single, dashPattern As Single())
Parameters
Type Name Description
PointF p1

The first point.

PointF p2

The second point.

Color lineColor

The line color.

float lineWidth

The line width.

float[] dashPattern

The dash pattern.

DrawLine(PointF, PointF, Pen)

Draws a line between two points, using the specified pen.

Declaration
public void DrawLine(PointF p1, PointF p2, Pen pen)
Public Sub DrawLine(p1 As PointF, p2 As PointF, pen As Pen)
Parameters
Type Name Description
PointF p1

The first point.

PointF p2

The second point.

Pen pen

The pen to use.

DrawLine(float, float, float, float, Pen)

Draws a line between two points, using the specified pen.

Declaration
public void DrawLine(float x1, float y1, float x2, float y2, Pen pen)
Public Sub DrawLine(x1 As Single, y1 As Single, x2 As Single, y2 As Single, pen As Pen)
Parameters
Type Name Description
float x1

The X coordinate of the first point.

float y1

The Y coordinate of the first point.

float x2

The X coordinate of the second point.

float y2

The Y coordinate of the second point.

Pen pen

The pen to use.