# GrapeCity.Drawing.IDrawingContext.DrawLine

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Drawing_IDrawingContext_DrawLine_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawLine*">DrawLine Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Drawing_IDrawingContext_DrawLine_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawLine*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawLine_GrapeCity_Drawing_Pen_GrapeCity_Drawing_Point_GrapeCity_Drawing_Point_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawLine(GrapeCity.Drawing.Pen,GrapeCity.Drawing.Point,GrapeCity.Drawing.Point)">DrawLine(Pen, Point, Point)</h4>
<div class="markdown level1 summary"><p>Draws a line between the specified points using the specified Pen.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawLine(Pen pen, Point point1, Point point2)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawLine(pen As Pen, point1 As Point, point2 As Point)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Pen.html">Pen</a></td>
      <td><span class="parametername">pen</span></td>
      <td><p>The pen with which to stroke the line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Point.html">Point</a></td>
      <td><span class="parametername">point1</span></td>
      <td><p>The start point of the line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Point.html">Point</a></td>
      <td><span class="parametername">point2</span></td>
      <td><p>The end point of the line.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Drawing_IDrawingContext_DrawLine_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawLine*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawLine_GrapeCity_Drawing_Pen_System_Double_System_Double_System_Double_System_Double_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawLine(GrapeCity.Drawing.Pen,System.Double,System.Double,System.Double,System.Double)">DrawLine(Pen, double, double, double, double)</h4>
<div class="markdown level1 summary"><p>Draws a line between the specified points using the specified <a class="xref" href="GrapeCity.Spreadsheet.BorderLine.html">BorderLine</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawLine(Pen pen, double x, double y, double x2, double y2)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawLine(pen As Pen, x As Double, y As Double, x2 As Double, y2 As Double)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Pen.html">Pen</a></td>
      <td><span class="parametername">pen</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The x-coordinate of the start point of the line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate of the start point of the line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">x2</span></td>
      <td><p>The x-coordinate of the end point of the line.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">y2</span></td>
      <td><p>The y-coordinate of the end point of the line.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
