{{< psd/tize >}}
## DrawLine(Pen, Point, Point) {#drawline}

Draws a line connecting two [`Point`](../../point/) structures.

```csharp
public void DrawLine(Pen pen, Point point1, Point point2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | [`Pen`](../../pen/) that determines the color, width, and style of the line. |
| point1 | Point | [`Point`](../../point/) structure that represents the first point to connect. |
| point2 | Point | [`Point`](../../point/) structure that represents the second point to connect. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *pen* is null. |

### See Also

* class [Pen](../../pen/)
* struct [Point](../../point/)
* class [Graphics](../)
* namespace [Aspose.PSD](../../../aspose.psd/)
* assembly [Aspose.PSD](../../../)

---

## DrawLine(Pen, PointF, PointF) {#drawline_1}

Draws a line connecting two [`PointF`](../../pointf/) structures.

```csharp
public void DrawLine(Pen pen, PointF point1, PointF point2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | [`Pen`](../../pen/) that determines the color, width, and style of the line. |
| point1 | PointF | [`PointF`](../../pointf/) structure that represents the first point to connect. |
| point2 | PointF | [`PointF`](../../pointf/) structure that represents the second point to connect. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *pen* is null. |

### See Also

* class [Pen](../../pen/)
* struct [PointF](../../pointf/)
* class [Graphics](../)
* namespace [Aspose.PSD](../../../aspose.psd/)
* assembly [Aspose.PSD](../../../)

---

## DrawLine(Pen, int, int, int, int) {#drawline_2}

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

```csharp
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | [`Pen`](../../pen/) that determines the color, width, and style of the line. |
| x1 | Int32 | The x-coordinate of the first point. |
| y1 | Int32 | The y-coordinate of the first point. |
| x2 | Int32 | The x-coordinate of the second point. |
| y2 | Int32 | The y-coordinate of the second point. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *pen* is null. |

### See Also

* class [Pen](../../pen/)
* class [Graphics](../)
* namespace [Aspose.PSD](../../../aspose.psd/)
* assembly [Aspose.PSD](../../../)

---

## DrawLine(Pen, float, float, float, float) {#drawline_3}

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

```csharp
public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| pen | Pen | [`Pen`](../../pen/) that determines the color, width, and style of the line. |
| x1 | Single | The x-coordinate of the first point. |
| y1 | Single | The y-coordinate of the first point. |
| x2 | Single | The x-coordinate of the second point. |
| y2 | Single | The y-coordinate of the second point. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *pen* is null. |

### See Also

* class [Pen](../../pen/)
* class [Graphics](../)
* namespace [Aspose.PSD](../../../aspose.psd/)
* assembly [Aspose.PSD](../../../)


