# C1.Util.DX.Direct2D.WindowRenderTarget.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_WindowRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.WindowRenderTarget.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_WindowRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.WindowRenderTarget.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_WindowRenderTarget_Create_C1_Util_DX_Direct2D_Factory_C1_Util_DX_Direct2D_RenderTargetProperties_C1_Util_DX_Direct2D_HwndRenderTargetProperties_" data-uid="C1.Util.DX.Direct2D.WindowRenderTarget.Create(C1.Util.DX.Direct2D.Factory,C1.Util.DX.Direct2D.RenderTargetProperties,C1.Util.DX.Direct2D.HwndRenderTargetProperties)">Create(Factory, RenderTargetProperties, HwndRenderTargetProperties)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.Util.DX.Direct2D.WindowRenderTarget.html">WindowRenderTarget</a>, a render target that renders to a window.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static WindowRenderTarget Create(Factory factory, RenderTargetProperties renderTargetProperties, HwndRenderTargetProperties hwndProperties)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, renderTargetProperties As RenderTargetProperties, hwndProperties As HwndRenderTargetProperties) As WindowRenderTarget</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.Factory.html">Factory</a></td>
      <td><span class="parametername">factory</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.Direct2D.Factory.html">Factory</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.RenderTargetProperties.html">RenderTargetProperties</a></td>
      <td><span class="parametername">renderTargetProperties</span></td>
      <td><p>The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering. For information about supported pixel formats, see  {{Supported Pixel  Formats and Alpha Modes}}.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.HwndRenderTargetProperties.html">HwndRenderTargetProperties</a></td>
      <td><span class="parametername">hwndProperties</span></td>
      <td><p>The window handle, initial size (in pixels), and present options.</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.WindowRenderTarget.html">WindowRenderTarget</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_WindowRenderTarget_Create_C1_Util_DX_Direct2D_Factory_C1_Util_DX_Direct2D_RenderTargetProperties_C1_Util_DX_Direct2D_HwndRenderTargetProperties__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>When you create a render target and hardware acceleration is available, you allocate resources on the computer's GPU. By creating a render target once and retaining it as long as possible, you gain performance benefits. Your application should create render targets once and hold onto them for the life of the application or until the {{D2DERR_RECREATE_TARGET}} error is received. When you receive this error, you need to recreate the render target (and any resources it created).</p>
</div>
</div>
