# C1.Util.DX.Direct2D.DeviceContext.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_DeviceContext_Create_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_DeviceContext_Create_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_DeviceContext_Create_C1_Util_DX_DXGI_Surface_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create(C1.Util.DX.DXGI.Surface)">Create(Surface)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DeviceContext Create(Surface surface)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(surface As Surface) As DeviceContext</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.DXGI.Surface.html">Surface</a></td>
      <td><span class="parametername">surface</span></td>
      <td><p>The surface.</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.DeviceContext.html">DeviceContext</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_DeviceContext_Create_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_DeviceContext_Create_C1_Util_DX_DXGI_Surface_C1_Util_DX_Direct2D_CreationProperties_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create(C1.Util.DX.DXGI.Surface,C1.Util.DX.Direct2D.CreationProperties)">Create(Surface, CreationProperties)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Direct2D.Device.html">Device</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DeviceContext Create(Surface surface, CreationProperties creationProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(surface As Surface, creationProperties As CreationProperties) As DeviceContext</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.DXGI.Surface.html">Surface</a></td>
      <td><span class="parametername">surface</span></td>
      <td><p>The surface.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.CreationProperties.html">CreationProperties</a></td>
      <td><span class="parametername">creationProperties</span></td>
      <td><p>The creation 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.DeviceContext.html">DeviceContext</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_DeviceContext_Create_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_DeviceContext_Create_C1_Util_DX_Direct2D_Device_C1_Util_DX_Direct2D_DeviceContextOptions_" data-uid="C1.Util.DX.Direct2D.DeviceContext.Create(C1.Util.DX.Direct2D.Device,C1.Util.DX.Direct2D.DeviceContextOptions)">Create(Device, DeviceContextOptions)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a> class using an existing <a class="xref" href="C1.Util.DX.Direct2D.Device.html">Device</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static DeviceContext Create(Device device, DeviceContextOptions options)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(device As Device, options As DeviceContextOptions) As DeviceContext</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.Device.html">Device</a></td>
      <td><span class="parametername">device</span></td>
      <td><p>The device.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.DeviceContextOptions.html">DeviceContextOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>The options to be applied to the created device context.</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.DeviceContext.html">DeviceContext</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_DeviceContext_Create_C1_Util_DX_Direct2D_Device_C1_Util_DX_Direct2D_DeviceContextOptions__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The new device context will not have a  selected target bitmap. The caller must create and select a bitmap as the target surface of the context.</p>
</div>
</div>
