# C1.Util.DX.Direct2D.Bitmap1.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Size2L_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.Size2L)">Create(DeviceContext, Size2L)</h4>
<div class="markdown level1 summary"><p>Creates a Direct2D bitmap from a pointer to in-memory source data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Size2L size)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, size As Size2L) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2L.html">Size2L</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The dimension of the bitmap to create in pixels.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Size2L_C1_Util_DX_Direct2D_BitmapProperties1_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.Size2L,C1.Util.DX.Direct2D.BitmapProperties1)">Create(DeviceContext, Size2L, BitmapProperties1)</h4>
<div class="markdown level1 summary"><p>Creates a Direct2D bitmap from a pointer to in-memory source data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, BitmapProperties1 bitmapProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, size As Size2L, bitmapProperties As BitmapProperties1) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2L.html">Size2L</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The dimension of the bitmap to create in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapProperties1.html">BitmapProperties1</a></td>
      <td><span class="parametername">bitmapProperties</span></td>
      <td><p>The pixel format and dots per inch (DPI) of the bitmap to create.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Size2L_C1_Util_DX_DataStream_System_Int32_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.Size2L,C1.Util.DX.DataStream,System.Int32)">Create(DeviceContext, Size2L, DataStream, int)</h4>
<div class="markdown level1 summary"><p>Creates a Direct2D bitmap from a pointer to in-memory source data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, size As Size2L, dataStream As DataStream, pitch As Integer) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2L.html">Size2L</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The dimension of the bitmap to create in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">dataStream</span></td>
      <td><p>A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pitch</span></td>
      <td><p>The byte count of each scanline, which is equal to (the image width in pixels * the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Size2L_C1_Util_DX_DataStream_System_Int32_C1_Util_DX_Direct2D_BitmapProperties1_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.Size2L,C1.Util.DX.DataStream,System.Int32,C1.Util.DX.Direct2D.BitmapProperties1)">Create(DeviceContext, Size2L, DataStream, int, BitmapProperties1)</h4>
<div class="markdown level1 summary"><p>Creates a Direct2D bitmap from a pointer to in-memory source data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch, BitmapProperties1 bitmapProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, size As Size2L, dataStream As DataStream, pitch As Integer, bitmapProperties As BitmapProperties1) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2L.html">Size2L</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The dimension of the bitmap to create in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a></td>
      <td><span class="parametername">dataStream</span></td>
      <td><p>A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pitch</span></td>
      <td><p>The byte count of each scanline, which is equal to (the image width in pixels * the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapProperties1.html">BitmapProperties1</a></td>
      <td><span class="parametername">bitmapProperties</span></td>
      <td><p>The pixel format and dots per inch (DPI) of the bitmap to create.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_DXGI_Surface_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.DXGI.Surface)">Create(DeviceContext, Surface)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.Util.DX.Direct2D.Bitmap.html">Bitmap</a> whose data is shared with another resource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Surface surface)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, surface As Surface) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.Surface.html">Surface</a></td>
      <td><span class="parametername">surface</span></td>
      <td><p>An <a class="xref" href="C1.Util.DX.DXGI.Surface.html">Surface</a> that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_DXGI_Surface_C1_Util_DX_Direct2D_BitmapProperties1_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.DXGI.Surface,C1.Util.DX.Direct2D.BitmapProperties1)">Create(DeviceContext, Surface, BitmapProperties1)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.Util.DX.Direct2D.Bitmap.html">Bitmap</a> whose data is shared with another resource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, Surface surface, BitmapProperties1 bitmapProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, surface As Surface, bitmapProperties As BitmapProperties1) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.RenderTarget.html">RenderTarget</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.Surface.html">Surface</a></td>
      <td><span class="parametername">surface</span></td>
      <td><p>An <a class="xref" href="C1.Util.DX.DXGI.Surface.html">Surface</a> that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapProperties1.html">BitmapProperties1</a></td>
      <td><span class="parametername">bitmapProperties</span></td>
      <td><p>The pixel format  and DPI of the bitmap to create . The <a class="xref" href="C1.Util.DX.DXGI.Format.html">Format</a> portion of the pixel format  must match the <a class="xref" href="C1.Util.DX.DXGI.Format.html">Format</a> of data or the method will fail, but the alpha modes don't have to match. To prevent a  mismatch, you can pass NULL or the value obtained from the {{D2D1::PixelFormat}} helper function. The DPI settings do not have to match those of data. If both dpiX and dpiY are  0.0f, the default DPI, 96, is used.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_WIC_BitmapSource_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.WIC.BitmapSource)">Create(DeviceContext, BitmapSource)</h4>
<div class="markdown level1 summary"><p>Creates a Bitmap from a wic bitmap.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmapSource)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, wicBitmapSource As BitmapSource) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>The render target.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.WIC.BitmapSource.html">BitmapSource</a></td>
      <td><span class="parametername">wicBitmapSource</span></td>
      <td><p>A reference to a <a class="xref" href="C1.Util.DX.WIC.BitmapSource.html">BitmapSource</a> wic bitmap.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_Bitmap1_Create_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_Bitmap1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_WIC_BitmapSource_C1_Util_DX_Direct2D_BitmapProperties1_" data-uid="C1.Util.DX.Direct2D.Bitmap1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.WIC.BitmapSource,C1.Util.DX.Direct2D.BitmapProperties1)">Create(DeviceContext, BitmapSource, BitmapProperties1)</h4>
<div class="markdown level1 summary"><p>Creates a Bitmap from a wic bitmap.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmap, BitmapProperties1 bitmapProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(deviceContext As DeviceContext, wicBitmap As BitmapSource, bitmapProperties As BitmapProperties1) 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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">deviceContext</span></td>
      <td><p>The render target.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.WIC.BitmapSource.html">BitmapSource</a></td>
      <td><span class="parametername">wicBitmap</span></td>
      <td><p>The wic bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapProperties1.html">BitmapProperties1</a></td>
      <td><span class="parametername">bitmapProperties</span></td>
      <td><p>The bitmap properties.</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="C1.Util.DX.Direct2D.Bitmap1.html">Bitmap1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
