# C1.WPF.FlexGrid.C1FlexGrid.GetGridImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.GetGridImage*">GetGridImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.GetGridImage*"></a>
<h4 id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_C1_WPF_FlexGrid_CellRange_C1_WPF_FlexGrid_ScaleMode_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.GetGridImage(C1.WPF.FlexGrid.CellRange,C1.WPF.FlexGrid.ScaleMode)">GetGridImage(CellRange, ScaleMode)</h4>
<div class="markdown level1 summary"><p>Gets a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> that represents a given part of the grid.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public FrameworkElement GetGridImage(CellRange rng, ScaleMode scaleMode = ScaleMode.ActualSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetGridImage(rng As CellRange, Optional scaleMode As ScaleMode = ScaleMode.ActualSize) As FrameworkElement</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.WPF.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">rng</span></td>
      <td><p><a class="xref" href="C1.WPF.FlexGrid.CellRange.html">CellRange</a> to include in the image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.FlexGrid.ScaleMode.html">ScaleMode</a></td>
      <td><span class="parametername">scaleMode</span></td>
      <td><p><a class="xref" href="C1.WPF.FlexGrid.ScaleMode.html">ScaleMode</a> that determine how will the image get scaled.</p>
</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.windows.frameworkelement">FrameworkElement</a></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> that represents a given part of the grid.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.GetGridImage*"></a>
<h4 id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_C1_WPF_FlexGrid_CellRange_System_Windows_Size_C1_WPF_FlexGrid_ScaleMode_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.GetGridImage(C1.WPF.FlexGrid.CellRange,System.Windows.Size,C1.WPF.FlexGrid.ScaleMode)">GetGridImage(CellRange, Size, ScaleMode)</h4>
<div class="markdown level1 summary"><p>Gets a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> that represents a given part of the grid stretched to desired size.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public FrameworkElement GetGridImage(CellRange rng, Size size, ScaleMode scaleMode = ScaleMode.ActualSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetGridImage(rng As CellRange, size As Size, Optional scaleMode As ScaleMode = ScaleMode.ActualSize) As FrameworkElement</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.WPF.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">rng</span></td>
      <td><p><a class="xref" href="C1.WPF.FlexGrid.CellRange.html">CellRange</a> to include in the image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.size">Size</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The desired page size.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.FlexGrid.ScaleMode.html">ScaleMode</a></td>
      <td><span class="parametername">scaleMode</span></td>
      <td><p><a class="xref" href="C1.WPF.FlexGrid.ScaleMode.html">ScaleMode</a> that determine how will the image get scaled.</p>
</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.windows.frameworkelement">FrameworkElement</a></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> that represents a given part of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_FlexGrid_C1FlexGrid_GetGridImage_C1_WPF_FlexGrid_CellRange_System_Windows_Size_C1_WPF_FlexGrid_ScaleMode__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <a class="xref" href="C1.WPF.FlexGrid.html">C1.WPF.FlexGrid</a> control uses this method when printing scale mode is set to ScaleMode.PageWidth.
This method ignores the size of FlexGrid control being printed.
Instead, it stretches star sizing columns according to the page width.</p>
</div>
</div>
