# C1.Util.Drawing.GetContentRect

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_Drawing_GetContentRect_" data-uid="C1.Util.Drawing.GetContentRect*">GetContentRect Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_Drawing_GetContentRect_" data-uid="C1.Util.Drawing.GetContentRect*"></a>
<h4 id="C1_Util_Drawing_GetContentRect_GrapeCity_Documents_Drawing_Image_System_Drawing_RectangleF_C1_Util_ContentAlignment_C1_Util_ImageSizeMode_" data-uid="C1.Util.Drawing.GetContentRect(GrapeCity.Documents.Drawing.Image,System.Drawing.RectangleF,C1.Util.ContentAlignment,C1.Util.ImageSizeMode)">GetContentRect(Image, RectangleF, ContentAlignment, ImageSizeMode)</h4>
<div class="markdown level1 summary"><p>Gets render rectangle based on image, alignment, and size mode</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static RectangleF GetContentRect(Image img, RectangleF rc, ContentAlignment align, ImageSizeMode mode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetContentRect(img As Image, rc As RectangleF, align As ContentAlignment, mode As ImageSizeMode) As RectangleF</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">Image</span></td>
      <td><span class="parametername">img</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a> structure that specifies the size of the object, in points.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the object, in points.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.ContentAlignment.html">ContentAlignment</a></td>
      <td><span class="parametername">align</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.ImageSizeMode.html">ImageSizeMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_Drawing_GetContentRect_" data-uid="C1.Util.Drawing.GetContentRect*"></a>
<h4 id="C1_Util_Drawing_GetContentRect_System_Drawing_SizeF_System_Drawing_RectangleF_C1_Util_ContentAlignment_C1_Util_ImageSizeMode_" data-uid="C1.Util.Drawing.GetContentRect(System.Drawing.SizeF,System.Drawing.RectangleF,C1.Util.ContentAlignment,C1.Util.ImageSizeMode)">GetContentRect(SizeF, RectangleF, ContentAlignment, ImageSizeMode)</h4>
<div class="markdown level1 summary"><p>Gets render rectangle based on content/image size, alignment, and size mode</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static RectangleF GetContentRect(SizeF sz, RectangleF rc, ContentAlignment align, ImageSizeMode mode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetContentRect(sz As SizeF, rc As RectangleF, align As ContentAlignment, mode As ImageSizeMode) As RectangleF</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.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">sz</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a> structure that specifies the size of the object, in points.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the object, in points.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.ContentAlignment.html">ContentAlignment</a></td>
      <td><span class="parametername">align</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.ImageSizeMode.html">ImageSizeMode</a></td>
      <td><span class="parametername">mode</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
