# C1.Util.DX.Direct2D.RenderTarget.DrawRectangle

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_RenderTarget_DrawRectangle_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawRectangle*">DrawRectangle Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_RenderTarget_DrawRectangle_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawRectangle*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawRectangle_C1_Util_DX_RectF_C1_Util_DX_Direct2D_Brush_System_Single_C1_Util_DX_Direct2D_StrokeStyle_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawRectangle(C1.Util.DX.RectF,C1.Util.DX.Direct2D.Brush,System.Single,C1.Util.DX.Direct2D.StrokeStyle)">DrawRectangle(RectF, Brush, float, StrokeStyle)</h4>
<div class="markdown level1 summary"><p>void ID2D1RenderTarget::DrawRectangle([In] const D2D_RECT_F* rect,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawRectangle(RectF rect, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawRectangle(rect As RectF, brush As Brush, strokeWidth As Single, Optional strokeStyle As StrokeStyle = Nothing)</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="C1.Util.DX.RectF.html">RectF</a></td>
      <td><span class="parametername">rect</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.Brush.html">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">strokeWidth</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.StrokeStyle.html">StrokeStyle</a></td>
      <td><span class="parametername">strokeStyle</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_RenderTarget_DrawRectangle_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawRectangle*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawRectangle_C1_Util_DX_RectF__C1_Util_DX_Direct2D_Brush_System_Single_C1_Util_DX_Direct2D_StrokeStyle_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawRectangle(C1.Util.DX.RectF@,C1.Util.DX.Direct2D.Brush,System.Single,C1.Util.DX.Direct2D.StrokeStyle)">DrawRectangle(ref RectF, Brush, float, StrokeStyle)</h4>
<div class="markdown level1 summary"><p>void ID2D1RenderTarget::DrawRectangle([In] const D2D_RECT_F* rect,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[CLSCompliant(false)]
public void DrawRectangle(ref RectF rect, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;CLSCompliant(False)&gt;
Public Sub DrawRectangle(ByRef rect As RectF, brush As Brush, strokeWidth As Single, Optional strokeStyle As StrokeStyle = Nothing)</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="C1.Util.DX.RectF.html">RectF</a></td>
      <td><span class="parametername">rect</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.Brush.html">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">strokeWidth</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.StrokeStyle.html">StrokeStyle</a></td>
      <td><span class="parametername">strokeStyle</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
