# C1.Util.DX.WIC.BitmapSource.CopyPixels

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*">CopyPixels Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_C1_Util_DX_RectL_System_Int32_C1_Util_DX_DataPointer_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(C1.Util.DX.RectL,System.Int32,C1.Util.DX.DataPointer)">CopyPixels(RectL, int, DataPointer)</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(RectL rectangle, int stride, DataPointer dataPointer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(rectangle As RectL, stride As Integer, dataPointer As DataPointer)</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.RectL.html">RectL</a></td>
      <td><span class="parametername">rectangle</span></td>
      <td><dd>
    <p>The rectangle to copy. A <strong><code>null</code></strong> value specifies the entire bitmap.</p>
</dd>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">stride</span></td>
      <td><dd>
    <p>The stride of the bitmap</p>
</dd>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataPointer.html">DataPointer</a></td>
      <td><span class="parametername">dataPointer</span></td>
      <td><dd>
    <p>A reference to the buffer.</p>
</dd>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_System_Int32_C1_Util_DX_DataPointer_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(System.Int32,C1.Util.DX.DataPointer)">CopyPixels(int, DataPointer)</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(int stride, DataPointer dataPointer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(stride As Integer, dataPointer As DataPointer)</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">stride</span></td>
      <td><dd>
    <p>The stride of the bitmap</p>
</dd>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataPointer.html">DataPointer</a></td>
      <td><span class="parametername">dataPointer</span></td>
      <td><dd>
    <p>A reference to the buffer.</p>
</dd>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_System_Int32_System_IntPtr_System_Int32_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(System.Int32,System.IntPtr,System.Int32)">CopyPixels(int, IntPtr, int)</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(int stride, IntPtr dataPointer, int size)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(stride As Integer, dataPointer As IntPtr, size 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.int32">int</a></td>
      <td><span class="parametername">stride</span></td>
      <td><dd>
    <p>The stride of the bitmap</p>
</dd>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">dataPointer</span></td>
      <td><dd>
    <p>A reference to the buffer.</p>
</dd>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>Size of the buffer in bytes.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels__1_C1_Util_DX_RectL___0___" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels``1(C1.Util.DX.RectL,``0[])">CopyPixels&lt;T&gt;(RectL, T[])</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels&lt;T&gt;(RectL rectangle, T[] output) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(Of T As Structure)(rectangle As RectL, output As T())</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.RectL.html">RectL</a></td>
      <td><span class="parametername">rectangle</span></td>
      <td><p>The rectangle to copy.</p>
</td>
    </tr>
    <tr>
      <td>T[]</td>
      <td><span class="parametername">output</span></td>
      <td><p>The destination array. The size of the array must be sizeof(pixel) * rectangle.Width * rectangle.Height</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels__1___0___" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels``1(``0[])">CopyPixels&lt;T&gt;(T[])</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels&lt;T&gt;(T[] output) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(Of T As Structure)(output As T())</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>T[]</td>
      <td><span class="parametername">output</span></td>
      <td><p>The destination array. The size of the array must be sizeof(pixel) * Width * Height</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_C1_Util_DX_RectL_System_Byte___System_Int32_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(C1.Util.DX.RectL,System.Byte[],System.Int32)">CopyPixels(RectL, byte[], int)</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(RectL rectangle, byte[] output, int stride)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(rectangle As RectL, output As Byte(), stride 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="C1.Util.DX.RectL.html">RectL</a></td>
      <td><span class="parametername">rectangle</span></td>
      <td><p>The rectangle to copy.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</td>
      <td><span class="parametername">output</span></td>
      <td><p>The destination array. The size of the array must be sizeof(pixel) * Width * Height</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">stride</span></td>
      <td><p>The stride (number of bytes per row).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_System_Byte___System_Int32_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(System.Byte[],System.Int32)">CopyPixels(byte[], int)</h4>
<div class="markdown level1 summary"><p>Instructs the object to produce pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(byte[] output, int stride)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(output As Byte(), stride 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.byte">byte</a>[]</td>
      <td><span class="parametername">output</span></td>
      <td><p>The destination array. The size of the array must be sizeof(pixel) * Width * Height</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">stride</span></td>
      <td><p>The stride (number of bytes per row).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_WIC_BitmapSource_CopyPixels_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels*"></a>
<h4 id="C1_Util_DX_WIC_BitmapSource_CopyPixels_System_IntPtr_System_Int32_System_Int32_System_IntPtr_" data-uid="C1.Util.DX.WIC.BitmapSource.CopyPixels(System.IntPtr,System.Int32,System.Int32,System.IntPtr)">CopyPixels(IntPtr, int, int, IntPtr)</h4>
<div class="markdown level1 summary"><p>HRESULT IWICBitmapSource::CopyPixels([In] const void* prc,[In] unsigned int cbStride,[In] unsigned int cbBufferSize,[In] void* pbBuffer)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyPixels(IntPtr rectangleRef, int stride, int bufferSize, IntPtr bufferRef)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyPixels(rectangleRef As IntPtr, stride As Integer, bufferSize As Integer, bufferRef As IntPtr)</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">IntPtr</a></td>
      <td><span class="parametername">rectangleRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">stride</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bufferSize</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">bufferRef</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
