# GrapeCity.Drawing.IDrawingContext.DrawText

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Drawing_IDrawingContext_DrawText_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText*">DrawText Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Drawing_IDrawingContext_DrawText_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawText_System_String_GrapeCity_Spreadsheet_Font_GrapeCity_Drawing_Rectangle_GrapeCity_Drawing_DrawingTextFormat_System_Double_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText(System.String,GrapeCity.Spreadsheet.Font,GrapeCity.Drawing.Rectangle,GrapeCity.Drawing.DrawingTextFormat,System.Double)">DrawText(string, Font, Rectangle, DrawingTextFormat, double)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string in the specified rectangle with the specified <a class="xref" href="GrapeCity.Drawing.Brush.html">Brush</a> and <span class="xref">GrapeCity.Spreadsheet.Font</span> objects.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawText(string value, Font font, Rectangle rect, DrawingTextFormat drawingTextFormat = DrawingTextFormat.None, double rotation = 0)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawText(value As String, font As Font, rect As Rectangle, Optional drawingTextFormat As DrawingTextFormat = DrawingTextFormat.None, Optional rotation As Double = 0)</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>String to draw.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Font</span></td>
      <td><span class="parametername">font</span></td>
      <td><p><span class="xref">GrapeCity.Spreadsheet.Font</span> that defines the text format of the string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a></td>
      <td><span class="parametername">rect</span></td>
      <td><p><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a> structure that specifies the boundary of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.DrawingTextFormat.html">DrawingTextFormat</a></td>
      <td><span class="parametername">drawingTextFormat</span></td>
      <td><p><a class="xref" href="GrapeCity.Drawing.DrawingTextFormat.html">DrawingTextFormat</a> structure that specifies the drawing text format.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">rotation</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Drawing_IDrawingContext_DrawText_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawText_GrapeCity_Spreadsheet_RichText_GrapeCity_Drawing_Rectangle_GrapeCity_Drawing_DrawingTextFormat_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText(GrapeCity.Spreadsheet.RichText,GrapeCity.Drawing.Rectangle,GrapeCity.Drawing.DrawingTextFormat)">DrawText(RichText, Rectangle, DrawingTextFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string in the specified rectangle with the specified <a class="xref" href="GrapeCity.Drawing.Brush.html">Brush</a> and <span class="xref">GrapeCity.Spreadsheet.Font</span> objects.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawText(RichText richText, Rectangle rect, DrawingTextFormat drawingTextFormat = DrawingTextFormat.None)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawText(richText As RichText, rect As Rectangle, Optional drawingTextFormat As DrawingTextFormat = DrawingTextFormat.None)</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.Spreadsheet.RichText.html">RichText</a></td>
      <td><span class="parametername">richText</span></td>
      <td><p>The text to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a></td>
      <td><span class="parametername">rect</span></td>
      <td><p><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a> structure that specifies the boundary of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.DrawingTextFormat.html">DrawingTextFormat</a></td>
      <td><span class="parametername">drawingTextFormat</span></td>
      <td><p><a class="xref" href="GrapeCity.Drawing.DrawingTextFormat.html">DrawingTextFormat</a> structure that specifies the drawing text format.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Drawing_IDrawingContext_DrawText_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawText_GrapeCity_Drawing_TextDocument_GrapeCity_Drawing_Rectangle_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawText(GrapeCity.Drawing.TextDocument,GrapeCity.Drawing.Rectangle)">DrawText(TextDocument, Rectangle)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string in the specified rectangle with the specified <a class="xref" href="GrapeCity.Drawing.Brush.html">Brush</a> and <span class="xref">GrapeCity.Spreadsheet.Font</span> objects.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawText(TextDocument text, Rectangle rect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawText(text As TextDocument, rect As Rectangle)</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><span class="xref">TextDocument</span></td>
      <td><span class="parametername">text</span></td>
      <td><p>The text to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a></td>
      <td><span class="parametername">rect</span></td>
      <td><p><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a> structure that specifies the boundary of the drawn text.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
