# C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget*">CopyFromRenderTarget Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget(C1.Util.DX.Direct2D.RenderTarget)">CopyFromRenderTarget(RenderTarget)</h4>
<div class="markdown level1 summary"><p>Copies the specified region from the specified render target into the current 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 CopyFromRenderTarget(RenderTarget renderTarget)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFromRenderTarget(renderTarget As RenderTarget)</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.Direct2D.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</span></td>
      <td><p>The render target that contains the region to copy.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method does not update the size of the current bitmap. If the contents of the source bitmap do not fit in the current bitmap, this method fails. Also, note that this method does not perform format conversion, and will fail if the bitmap formats do not match. Calling this method may cause the current batch to flush if the bitmap is active in the batch. If the batch that was flushed does not complete successfully, this method fails. However, this method does not clear the error state of the render target on which the batch was flushed. The failing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a> and tag state will be returned at the next call to {{EndDraw}} or {{Flush}}.  All clips and layers must be popped off of the render target before calling this method.  The method returns {{D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT}} if any clips or layers are currently applied to the render target.</p>
</div>


<a id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Point2L_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Point2L)">CopyFromRenderTarget(RenderTarget, Point2L)</h4>
<div class="markdown level1 summary"><p>Copies the specified region from the specified render target into the current 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 CopyFromRenderTarget(RenderTarget renderTarget, Point2L destinationPoint)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFromRenderTarget(renderTarget As RenderTarget, destinationPoint As Point2L)</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.Direct2D.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</span></td>
      <td><p>The render target that contains the region to copy.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Point2L.html">Point2L</a></td>
      <td><span class="parametername">destinationPoint</span></td>
      <td><p>In the current bitmap, the upper-left corner of the area to which the region specified by srcRect is copied.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Point2L__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method does not update the size of the current bitmap. If the contents of the source bitmap do not fit in the current bitmap, this method fails. Also, note that this method does not perform format conversion, and will fail if the bitmap formats do not match. Calling this method may cause the current batch to flush if the bitmap is active in the batch. If the batch that was flushed does not complete successfully, this method fails. However, this method does not clear the error state of the render target on which the batch was flushed. The failing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a> and tag state will be returned at the next call to {{EndDraw}} or {{Flush}}.  All clips and layers must be popped off of the render target before calling this method.  The method returns {{D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT}} if any clips or layers are currently applied to the render target.</p>
</div>


<a id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Point2L_C1_Util_DX_RectL_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Point2L,C1.Util.DX.RectL)">CopyFromRenderTarget(RenderTarget, Point2L, RectL)</h4>
<div class="markdown level1 summary"><p>Copies the specified region from the specified render target into the current 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 CopyFromRenderTarget(RenderTarget renderTarget, Point2L destinationPoint, RectL sourceArea)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFromRenderTarget(renderTarget As RenderTarget, destinationPoint As Point2L, sourceArea As RectL)</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.Direct2D.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</span></td>
      <td><p>The render target that contains the region to copy.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Point2L.html">Point2L</a></td>
      <td><span class="parametername">destinationPoint</span></td>
      <td><p>In the current bitmap, the upper-left corner of the area to which the region specified by srcRect is copied.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectL.html">RectL</a></td>
      <td><span class="parametername">sourceArea</span></td>
      <td><p>The area of renderTarget to copy.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Point2L_C1_Util_DX_RectL__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method does not update the size of the current bitmap. If the contents of the source bitmap do not fit in the current bitmap, this method fails. Also, note that this method does not perform format conversion, and will fail if the bitmap formats do not match. Calling this method may cause the current batch to flush if the bitmap is active in the batch. If the batch that was flushed does not complete successfully, this method fails. However, this method does not clear the error state of the render target on which the batch was flushed. The failing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a> and tag state will be returned at the next call to {{EndDraw}} or {{Flush}}.  All clips and layers must be popped off of the render target before calling this method.  The method returns {{D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT}} if any clips or layers are currently applied to the render target.</p>
</div>


<a id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap_CopyFromRenderTarget_System_Nullable_C1_Util_DX_Point2L__C1_Util_DX_Direct2D_RenderTarget_System_Nullable_C1_Util_DX_RectL__" data-uid="C1.Util.DX.Direct2D.Bitmap.CopyFromRenderTarget(System.Nullable{C1.Util.DX.Point2L},C1.Util.DX.Direct2D.RenderTarget,System.Nullable{C1.Util.DX.RectL})">CopyFromRenderTarget(Point2L?, RenderTarget, RectL?)</h4>
<div class="markdown level1 summary"><p>HRESULT ID2D1Bitmap::CopyFromRenderTarget([In, Optional] const D2D_POINT_2U* destPoint,[In] ID2D1RenderTarget* renderTarget,[In, Optional] const D2D_RECT_U* srcRect)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyFromRenderTarget(Point2L? destPoint, RenderTarget renderTarget, RectL? srcRect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFromRenderTarget(destPoint As Point2L?, renderTarget As RenderTarget, srcRect As RectL?)</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.Point2L.html">Point2L</a>?</td>
      <td><span class="parametername">destPoint</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectL.html">RectL</a>?</td>
      <td><span class="parametername">srcRect</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
