# C1.Win.Bitmap.C1Bitmap.ExportFragment

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Bitmap_C1Bitmap_ExportFragment_" data-uid="C1.Win.Bitmap.C1Bitmap.ExportFragment*">ExportFragment Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Bitmap_C1Bitmap_ExportFragment_" data-uid="C1.Win.Bitmap.C1Bitmap.ExportFragment*"></a>
<h4 id="C1_Win_Bitmap_C1Bitmap_ExportFragment_System_IntPtr_C1_Win_Bitmap_ImageRect_" data-uid="C1.Win.Bitmap.C1Bitmap.ExportFragment(System.IntPtr,C1.Win.Bitmap.ImageRect)">ExportFragment(nint, ImageRect)</h4>
<div class="markdown level1 summary"><p>Copies a fragment of the image to a unmanaged block of memory.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int ExportFragment(nint dstPtr, ImageRect srcRect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ExportFragment(dstPtr As IntPtr, srcRect As ImageRect) As Integer</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.intptr">nint</a></td>
      <td><span class="parametername">dstPtr</span></td>
      <td><p>The pointer to a unmanaged block of memory or IntPtr.Zero.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.Bitmap.ImageRect.html">ImageRect</a></td>
      <td><span class="parametername">srcRect</span></td>
      <td><p>The source rectangle within 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.int32">int</a></td>
      <td><p>Returns the number of bytes in the requested fragment of the image.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_Bitmap_C1Bitmap_ExportFragment_" data-uid="C1.Win.Bitmap.C1Bitmap.ExportFragment*"></a>
<h4 id="C1_Win_Bitmap_C1Bitmap_ExportFragment_System_Drawing_Bitmap_C1_Win_Bitmap_ImageRect_" data-uid="C1.Win.Bitmap.C1Bitmap.ExportFragment(System.Drawing.Bitmap,C1.Win.Bitmap.ImageRect)">ExportFragment(Bitmap, ImageRect)</h4>
<div class="markdown level1 summary"><p>Copies a fragment of the image to the given System.Drawing.Bitmap.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void ExportFragment(Bitmap gdiBitmap, ImageRect srcRect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub ExportFragment(gdiBitmap As Bitmap, srcRect As ImageRect)</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.bitmap">Bitmap</a></td>
      <td><span class="parametername">gdiBitmap</span></td>
      <td><p>The destination System.Drawing.Bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.Bitmap.ImageRect.html">ImageRect</a></td>
      <td><span class="parametername">srcRect</span></td>
      <td><p>The source rectangle within the image.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
