# C1.Win.FlexGrid.C1FlexGridBase.CreateImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*">CreateImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage">CreateImage()</h4>
<div class="markdown level1 summary"><p>Creates an image of the entire grid.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Image CreateImage()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateImage() As Image</code></pre>
</div>
<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.image">Image</a></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing a metafile image of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Use this method to copy grid images to the clipboard so you can paste them into
documents or other applications.</p>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_examples">Examples</h5>
<p>The code below creates an image of a grid range and saves it to a PNG file that can be
included in other documents such as web pages:</p>
<pre><code class="lang-csharp">Image img = flex.CreateImage(0,0,10,5);
img.Save(@"c:\temp\grid.png", System.Drawing.Imaging.ImageFormat.Png);</code></pre>



<a id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage(System.Int32,System.Int32,System.Int32,System.Int32)">CreateImage(int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Creates an image of a portion 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 Image CreateImage(int topRow, int leftCol, int bottomRow, int rightCol)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateImage(topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer) As Image</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.int32">int</a></td>
      <td><span class="parametername">topRow</span></td>
      <td><p>Top row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">leftCol</span></td>
      <td><p>Left column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bottomRow</span></td>
      <td><p>Bottom row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rightCol</span></td>
      <td><p>Right column in the range.</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.drawing.image">Image</a></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing a metafile image of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_System_Int32_System_Int32_System_Int32_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The image returned includes any fixed and frozen cells in addition to the specified range.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_C1_Win_FlexGrid_CellRange_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage(C1.Win.FlexGrid.CellRange)">CreateImage(CellRange)</h4>
<div class="markdown level1 summary"><p>Creates an image of a portion 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 Image CreateImage(CellRange rg)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateImage(rg As CellRange) As Image</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.Win.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">rg</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> that specifies which cells should be included in the image.</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.drawing.image">Image</a></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing a metafile image of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_C1_Win_FlexGrid_CellRange__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The image returned includes any fixed and frozen cells in addition to the specified range.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_System_Int32_System_Int32_System_Int32_System_Int32_System_Drawing_Imaging_EmfType_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage(System.Int32,System.Int32,System.Int32,System.Int32,System.Drawing.Imaging.EmfType)">CreateImage(int, int, int, int, EmfType)</h4>
<div class="markdown level1 summary"><p>Creates an image of a portion 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 Image CreateImage(int topRow, int leftCol, int bottomRow, int rightCol, EmfType emfType)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateImage(topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer, emfType As EmfType) As Image</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.int32">int</a></td>
      <td><span class="parametername">topRow</span></td>
      <td><p>Top row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">leftCol</span></td>
      <td><p>Left column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bottomRow</span></td>
      <td><p>Bottom row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rightCol</span></td>
      <td><p>Right column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.emftype">EmfType</a></td>
      <td><span class="parametername">emfType</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.emftype">EmfType</a> value that determines the type of metafile to create.</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.drawing.image">Image</a></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing a metafile image of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_System_Int32_System_Int32_System_Int32_System_Int32_System_Drawing_Imaging_EmfType__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The image returned includes any fixed and frozen cells in addition to the specified range.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_C1_Win_FlexGrid_CellRange_System_Drawing_Imaging_EmfType_C1_Win_FlexGrid_DrawColorMode_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.CreateImage(C1.Win.FlexGrid.CellRange,System.Drawing.Imaging.EmfType,C1.Win.FlexGrid.DrawColorMode)">CreateImage(CellRange, EmfType, DrawColorMode)</h4>
<div class="markdown level1 summary"><p>Creates an image of a portion 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 Image CreateImage(CellRange rg, EmfType emfType, DrawColorMode colorMode = DrawColorMode.Color)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateImage(rg As CellRange, emfType As EmfType, Optional colorMode As DrawColorMode = DrawColorMode.Color) As Image</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.Win.FlexGrid.CellRange.html">CellRange</a></td>
      <td><span class="parametername">rg</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.CellRange.html">CellRange</a> that specifies which cells should be included in the image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.emftype">EmfType</a></td>
      <td><span class="parametername">emfType</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.emftype">EmfType</a> value that determines the type of metafile to create.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.DrawColorMode.html">DrawColorMode</a></td>
      <td><span class="parametername">colorMode</span></td>
      <td><p>result image color mode.</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.drawing.image">Image</a></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object containing a metafile image of the grid.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_CreateImage_C1_Win_FlexGrid_CellRange_System_Drawing_Imaging_EmfType_C1_Win_FlexGrid_DrawColorMode__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The image returned includes any fixed and frozen cells in addition to the specified range.</p>
</div>
</div>
