# C1.WPF.Bitmap.C1Bitmap.Import

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*">Import Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_C1_WPF_Bitmap_C1Bitmap_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(C1.WPF.Bitmap.C1Bitmap)">Import(C1Bitmap)</h4>
<div class="markdown level1 summary"><p>Loads the image from another instance of C1Bitmap.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(C1Bitmap bitmap)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(bitmap As C1Bitmap)</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.WPF.Bitmap.C1Bitmap.html">C1Bitmap</a></td>
      <td><span class="parametername">bitmap</span></td>
      <td><p>The source bitmap.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_System_Byte___System_Int32_System_Int32_C1_WPF_Bitmap_PixelFormat_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(System.Byte[],System.Int32,System.Int32,C1.WPF.Bitmap.PixelFormat)">Import(byte[], int, int, PixelFormat)</h4>
<div class="markdown level1 summary"><p>Loads the image from a byte array containing the pixels buffer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(byte[] bytes, int width, int height, PixelFormat pixelFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(bytes As Byte(), width As Integer, height As Integer, pixelFormat As PixelFormat)</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">bytes</span></td>
      <td><p>The source byte array with pixel buffer.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Bitmap.PixelFormat.html">PixelFormat</a></td>
      <td><span class="parametername">pixelFormat</span></td>
      <td><p>The pixel format of the image.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_System_Byte___System_Int32_System_Int32_System_Int32_C1_WPF_Bitmap_PixelFormat_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(System.Byte[],System.Int32,System.Int32,System.Int32,C1.WPF.Bitmap.PixelFormat)">Import(byte[], int, int, int, PixelFormat)</h4>
<div class="markdown level1 summary"><p>Loads the image from a byte array containing the pixels buffer with specified stride (bytes per row of 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 Import(byte[] bytes, int stride, int width, int height, PixelFormat pixelFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(bytes As Byte(), stride As Integer, width As Integer, height As Integer, pixelFormat As PixelFormat)</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">bytes</span></td>
      <td><p>The source byte array with pixel buffer.</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 (bytes per row) of the image data in the source byte array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Bitmap.PixelFormat.html">PixelFormat</a></td>
      <td><span class="parametername">pixelFormat</span></td>
      <td><p>The pixel format of the image.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_System_IntPtr_System_Int32_System_Int32_C1_WPF_Bitmap_PixelFormat_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(System.IntPtr,System.Int32,System.Int32,C1.WPF.Bitmap.PixelFormat)">Import(IntPtr, int, int, PixelFormat)</h4>
<div class="markdown level1 summary"><p>Loads the image from a unmanaged block of memory pointed by IntPtr.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(IntPtr srcPtr, int width, int height, PixelFormat pixelFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(srcPtr As IntPtr, width As Integer, height As Integer, pixelFormat As PixelFormat)</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">srcPtr</span></td>
      <td><p>The pointer to the beginning of the unmanaged block of memory.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Bitmap.PixelFormat.html">PixelFormat</a></td>
      <td><span class="parametername">pixelFormat</span></td>
      <td><p>The pixel format of the image.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_System_IntPtr_System_Int32_System_Int32_System_Int32_C1_WPF_Bitmap_PixelFormat_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(System.IntPtr,System.Int32,System.Int32,System.Int32,C1.WPF.Bitmap.PixelFormat)">Import(IntPtr, int, int, int, PixelFormat)</h4>
<div class="markdown level1 summary"><p>Loads the image from a unmanaged block of memory pointed by IntPtr and having the specified stride (bytes per row of 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 Import(IntPtr srcPtr, int stride, int width, int height, PixelFormat pixelFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(srcPtr As IntPtr, stride As Integer, width As Integer, height As Integer, pixelFormat As PixelFormat)</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">srcPtr</span></td>
      <td><p>The pointer to the beginning of the unmanaged block of memory.</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 (bytes per row) of the source image data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Bitmap.PixelFormat.html">PixelFormat</a></td>
      <td><span class="parametername">pixelFormat</span></td>
      <td><p>The pixel format of the image.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_System_Windows_Media_Imaging_WriteableBitmap_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(System.Windows.Media.Imaging.WriteableBitmap)">Import(WriteableBitmap)</h4>
<div class="markdown level1 summary"><p>Loads the image from a WriteableBitmap.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(WriteableBitmap writeableBitmap)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(writeableBitmap As WriteableBitmap)</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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">writeableBitmap</span></td>
      <td><p>The source WriteableBitmap.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_C1_Util_DX_Direct2D_Bitmap1_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(C1.Util.DX.Direct2D.Bitmap1)">Import(Bitmap1)</h4>
<div class="markdown level1 summary"><p>Loads the image from a D2D.Bitmap1 (created with D2D.BitmapOptions.CpuRead).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(Bitmap1 d2dBitmap)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(d2dBitmap As Bitmap1)</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.WPF.DX.4.6.2/C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td><span class="parametername">d2dBitmap</span></td>
      <td><p>The source D2D.Bitmap1 image created with D2D.BitmapOptions.CpuRead.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Bitmap_C1Bitmap_Import_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import*"></a>
<h4 id="C1_WPF_Bitmap_C1Bitmap_Import_C1_Util_DX_Direct2D_Bitmap1_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_RectL_" data-uid="C1.WPF.Bitmap.C1Bitmap.Import(C1.Util.DX.Direct2D.Bitmap1,C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.RectL)">Import(Bitmap1, DeviceContext, RectL)</h4>
<div class="markdown level1 summary"><p>Loads the image from a D2D.Bitmap1.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Import(Bitmap1 d2dBitmap, DeviceContext context, RectL srcRect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Import(d2dBitmap As Bitmap1, context As DeviceContext, 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.WPF.DX.4.6.2/C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td><span class="parametername">d2dBitmap</span></td>
      <td><p>The source D2D.Bitmap1 image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../C1.WPF.DX.4.6.2/C1.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>The device context used to create a D2D bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../C1.WPF.DX.4.6.2/C1.Util.DX.RectL.html">RectL</a></td>
      <td><span class="parametername">srcRect</span></td>
      <td><p>The source rectangle within d2dBitmap.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
