Graphics.DrawLine Method (Pen, Single, Single, Single, Single)

Draws a line connecting the two points specified by the coordinate pairs.

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

Syntax

C#
public void DrawLine(
	Pen pen,
	float x1,
	float y1,
	float x2,
	float y2
)

Parameters

pen

Type: Aurigma.GraphicsMill.AdvancedDrawing.Pen

A Pen that determines the color, width, and style of the line.
x1

Type: System.Single

The x-coordinate of the first point.
y1

Type: System.Single

The y-coordinate of the first point.
x2

Type: System.Single

The x-coordinate of the second point.
y2

Type: System.Single

The y-coordinate of the second point.

Remarks

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

Examples

C#
using (var bitmap = new Bitmap(160, 120, PixelFormat.Format24bppRgb, RgbColor.White))
using (var graphics = bitmap.GetAdvancedGraphics())
{
    graphics.DrawLine(new Pen(RgbColor.Red), 10, 10, 150, 110);
    bitmap.Save(@"Images\Output\out.png");
}

See Also

Reference

Manual