# C1.Framework.Drawing.Gdi.Graphics.Copy

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Drawing_Gdi_Graphics_Copy_" data-uid="C1.Framework.Drawing.Gdi.Graphics.Copy*">Copy Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Drawing_Gdi_Graphics_Copy_" data-uid="C1.Framework.Drawing.Gdi.Graphics.Copy*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Graphics_Copy_C1_Framework_Drawing_Gdi_Graphics_System_Drawing_Rectangle_System_Drawing_Point_" data-uid="C1.Framework.Drawing.Gdi.Graphics.Copy(C1.Framework.Drawing.Gdi.Graphics,System.Drawing.Rectangle,System.Drawing.Point)">Copy(Graphics, Rectangle, Point)</h4>
<div class="markdown level1 summary"><p>Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from
the specified source <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> object into a destination <b>Graphics</b> object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Copy(Graphics graphics, Rectangle destRectangle, Point srcPoint)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Copy(graphics As Graphics, destRectangle As Rectangle, srcPoint As Point)</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.Framework.Drawing.Gdi.Graphics.html">Graphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>A <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> indicate the source <b>Graphics</b> object</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td><span class="parametername">destRectangle</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a> indicates the destination rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point">Point</a></td>
      <td><span class="parametername">srcPoint</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.point">Point</a> indicates the upper-left corner of source rectangle.
The width and height of source rectangle are same as the destination rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Framework_Drawing_Gdi_Graphics_Copy_C1_Framework_Drawing_Gdi_Graphics_System_Drawing_Rectangle_System_Drawing_Point__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
  Copy only does clipping on the destination DC.
</p>
<p>
  If a rotation or shear transformation is in effect in the source device context, Copy will throw
  a <a class="xref" href="C1.Framework.SystemErrorException.html">SystemErrorException</a>. If other transformations exist in the source device context (and a matching
  transformation is not in effect in the destination device context), the rectangle in the destination device context
  is stretched, compressed, or rotated, as necessary. 
</p>
<p>
  If the color formats of the source and destination device contexts do not match, the Copy function converts
  the source color format to match the destination format. 
</p>
<p>
  When an enhanced metafile is being recorded, an error occurs if the source device context identifies
  an enhanced-metafile device context. it means a <a class="xref" href="C1.Framework.SystemErrorException.html">SystemErrorException</a> would be throw out.
</p>
<p>
  Not all devices support the Copy function. For more information, see the <b>RC_BITBLT</b> raster capability entry
  in the <b>GetDeviceCaps</b> function as well as the following: <b>MaskBlt</b>, <b>PlgBlt</b>, and <b>StretchBlt</b>.
</p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Framework.SystemErrorException.html">SystemErrorException</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Graphics_Copy_" data-uid="C1.Framework.Drawing.Gdi.Graphics.Copy*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Graphics_Copy_C1_Framework_Drawing_Gdi_Graphics_System_Drawing_Rectangle_System_Drawing_Rectangle_" data-uid="C1.Framework.Drawing.Gdi.Graphics.Copy(C1.Framework.Drawing.Gdi.Graphics,System.Drawing.Rectangle,System.Drawing.Rectangle)">Copy(Graphics, Rectangle, Rectangle)</h4>
<div class="markdown level1 summary"><p>Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from
the specified source <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> object into a destination <b>Graphics</b> object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Copy(Graphics graphics, Rectangle destRectangle, Rectangle srcRectangle)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Copy(graphics As Graphics, destRectangle As Rectangle, srcRectangle As Rectangle)</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.Framework.Drawing.Gdi.Graphics.html">Graphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>The source <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td><span class="parametername">destRectangle</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a> indicates the destination rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td><span class="parametername">srcRectangle</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a> indicates the source rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Framework_Drawing_Gdi_Graphics_Copy_C1_Framework_Drawing_Gdi_Graphics_System_Drawing_Rectangle_System_Drawing_Rectangle__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
  Copy only does clipping on the destination DC.
</p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Framework.SystemErrorException.html">SystemErrorException</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
