# C1.Util.DX.Direct2D.BitmapRenderTarget.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Direct2D_CompatibleRenderTargetOptions_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Direct2D.CompatibleRenderTargetOptions)">Create(RenderTarget, CompatibleRenderTargetOptions)</h4>
<div class="markdown level1 summary"><p>Creates a bitmap render target for use during intermediate offscreen drawing that is compatible with the current render targe with same size, pixel size and pixel format.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static BitmapRenderTarget Create(RenderTarget renderTarget, CompatibleRenderTargetOptions options)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(renderTarget As RenderTarget, options As CompatibleRenderTargetOptions) As BitmapRenderTarget</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.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</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.Direct2D.CompatibleRenderTargetOptions.html">CompatibleRenderTargetOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>A value that specifies whether the new render target must be compatible with GDI.</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.BitmapRenderTarget.html">BitmapRenderTarget</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Direct2D_CompatibleRenderTargetOptions_C1_Util_DX_Size2F_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Direct2D.CompatibleRenderTargetOptions,C1.Util.DX.Size2F)">Create(RenderTarget, CompatibleRenderTargetOptions, Size2F)</h4>
<div class="markdown level1 summary"><p>Creates a bitmap render target for use during intermediate offscreen drawing that is compatible with the current render target with same pixel size and pixel format.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static BitmapRenderTarget Create(RenderTarget renderTarget, CompatibleRenderTargetOptions options, Size2F desiredSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(renderTarget As RenderTarget, options As CompatibleRenderTargetOptions, desiredSize As Size2F) As BitmapRenderTarget</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.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</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.Direct2D.CompatibleRenderTargetOptions.html">CompatibleRenderTargetOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>A value that specifies whether the new render target must be compatible with GDI.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2F.html">Size2F</a></td>
      <td><span class="parametername">desiredSize</span></td>
      <td><p>The desired size of the new render target in device-independent pixels if it should be different from the original render target. 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.BitmapRenderTarget.html">BitmapRenderTarget</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Direct2D_CompatibleRenderTargetOptions_System_Nullable_C1_Util_DX_Direct2D_PixelFormat__" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Direct2D.CompatibleRenderTargetOptions,System.Nullable{C1.Util.DX.Direct2D.PixelFormat})">Create(RenderTarget, CompatibleRenderTargetOptions, PixelFormat?)</h4>
<div class="markdown level1 summary"><p>Creates a bitmap render target for use during intermediate offscreen drawing that is compatible with the current render target with same size and pixel size.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static BitmapRenderTarget Create(RenderTarget renderTarget, CompatibleRenderTargetOptions options, PixelFormat? desiredFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(renderTarget As RenderTarget, options As CompatibleRenderTargetOptions, desiredFormat As PixelFormat?) As BitmapRenderTarget</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.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</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.Direct2D.CompatibleRenderTargetOptions.html">CompatibleRenderTargetOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>A value that specifies whether the new render target must be compatible with GDI.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.PixelFormat.html">PixelFormat</a>?</td>
      <td><span class="parametername">desiredFormat</span></td>
      <td><p>The desired pixel format and alpha mode of the new render target. If the pixel format is set to DXGI_FORMAT_UNKNOWN, the new render target uses the same pixel format as the original render target. If the alpha mode is <a class="xref" href="C1.Util.DX.Direct2D.AlphaMode.html#C1_Util_DX_Direct2D_AlphaMode_Unknown">Unknown</a>, the alpha mode of the new render target defaults to D2D1_ALPHA_MODE_PREMULTIPLIED. For information about supported pixel formats, see  {{Supported Pixel  Formats and Alpha Modes}}.</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.BitmapRenderTarget.html">BitmapRenderTarget</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Direct2D_CompatibleRenderTargetOptions_System_Nullable_C1_Util_DX_Size2F__System_Nullable_C1_Util_DX_Size2L__System_Nullable_C1_Util_DX_Direct2D_PixelFormat__" data-uid="C1.Util.DX.Direct2D.BitmapRenderTarget.Create(C1.Util.DX.Direct2D.RenderTarget,C1.Util.DX.Direct2D.CompatibleRenderTargetOptions,System.Nullable{C1.Util.DX.Size2F},System.Nullable{C1.Util.DX.Size2L},System.Nullable{C1.Util.DX.Direct2D.PixelFormat})">Create(RenderTarget, CompatibleRenderTargetOptions, Size2F?, Size2L?, PixelFormat?)</h4>
<div class="markdown level1 summary"><p>Creates a bitmap render target for use during intermediate offscreen drawing that is compatible with the current render target.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static BitmapRenderTarget Create(RenderTarget renderTarget, CompatibleRenderTargetOptions options, Size2F? desiredSize, Size2L? desiredPixelSize, PixelFormat? desiredFormat)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(renderTarget As RenderTarget, options As CompatibleRenderTargetOptions, desiredSize As Size2F?, desiredPixelSize As Size2L?, desiredFormat As PixelFormat?) As BitmapRenderTarget</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.RenderTarget.html">RenderTarget</a></td>
      <td><span class="parametername">renderTarget</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.Direct2D.CompatibleRenderTargetOptions.html">CompatibleRenderTargetOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>A value that specifies whether the new render target must be compatible with GDI.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2F.html">Size2F</a>?</td>
      <td><span class="parametername">desiredSize</span></td>
      <td><p>The desired size of the new render target in device-independent pixels if it should be different from the original render target. For more information, see the Remarks section.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Size2L.html">Size2L</a>?</td>
      <td><span class="parametername">desiredPixelSize</span></td>
      <td><p>The desired size of the new render target in pixels if it should be different from the original render target. For more information, see the Remarks section.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.PixelFormat.html">PixelFormat</a>?</td>
      <td><span class="parametername">desiredFormat</span></td>
      <td><p>The desired pixel format and alpha mode of the new render target. If the pixel format is set to DXGI_FORMAT_UNKNOWN, the new render target uses the same pixel format as the original render target. If the alpha mode is <a class="xref" href="C1.Util.DX.Direct2D.AlphaMode.html#C1_Util_DX_Direct2D_AlphaMode_Unknown">Unknown</a>, the alpha mode of the new render target defaults to D2D1_ALPHA_MODE_PREMULTIPLIED. For information about supported pixel formats, see  {{Supported Pixel  Formats and Alpha Modes}}.</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.BitmapRenderTarget.html">BitmapRenderTarget</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_BitmapRenderTarget_Create_C1_Util_DX_Direct2D_RenderTarget_C1_Util_DX_Direct2D_CompatibleRenderTargetOptions_System_Nullable_C1_Util_DX_Size2F__System_Nullable_C1_Util_DX_Size2L__System_Nullable_C1_Util_DX_Direct2D_PixelFormat___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The pixel size and DPI of the new render target can be altered by specifying values for desiredSize or desiredPixelSize:  If desiredSize is specified but desiredPixelSize is not, the pixel size is computed from the desired size using the parent target DPI. If the desiredSize maps to a integer-pixel size, the DPI of the compatible render target is the same as the DPI of the parent target.  If desiredSize maps to a fractional-pixel size, the pixel size is rounded up to the nearest integer and the DPI for the compatible render target is slightly higher than the DPI of the parent render target. In all cases, the coordinate (desiredSize.width, desiredSize.height) maps to the lower-right corner of the compatible render target.If the desiredPixelSize is specified and desiredSize is not, the DPI of the new render target is the same as the original render target.If both desiredSize and desiredPixelSize are specified, the DPI of the new render target is computed to account for the difference in scale.If neither desiredSize nor desiredPixelSize is specified, the new render target size and DPI match the original render target.</p>
</div>
</div>
