This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.DrawLine Method (Pen, Int32, Int32, Int32, Int32)

Draws a line.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Sub DrawLine ( _
	pen As Pen, _
	x1 As Integer, _
	y1 As Integer, _
	x2 As Integer, _
	y2 As Integer _
)
C#
public void DrawLine(
	Pen pen,
	int x1,
	int y1,
	int x2,
	int y2
)

Parameters

pen

Type: Aurigma.GraphicsMill.Drawing.Pen

Pen object which is used to draw a line.
x1

Type: System.Int32

X-coordinate of the start point of the line.
y1

Type: System.Int32

Y-coordinate of the start point of the line.
x2

Type: System.Int32

X-coordinate of the end point of the line.
y2

Type: System.Int32

Y-coordinate of the end point of the line.

Remarks

In this method line is defined with two points which should be connected with this line.

All the coordinates are measured in units specified with Unit property.

Examples

Visual Basic
Dim gdiGraphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = _
 Aurigma.GraphicsMill.Drawing.GdiGraphics.FromHwnd(PictureBox1.Handle)

Dim pen As New Aurigma.GraphicsMill.Drawing.Pen(Aurigma.GraphicsMill.RgbColor.Red, 1)

gdiGraphics.DrawLine(pen, 50, 0, 50, 100)
C#
Aurigma.GraphicsMill.Drawing.GdiGraphics gdiGraphics =
    Aurigma.GraphicsMill.Drawing.GdiGraphics.FromHwnd(PictureBox1.Handle);

Aurigma.GraphicsMill.Drawing.Pen pen =
    new Aurigma.GraphicsMill.Drawing.Pen(Aurigma.GraphicsMill.RgbColor.Red, 1);

gdiGraphics.DrawLine(pen, 50, 0, 50, 100);

See Also

Reference