# C1.Util.DX.Direct2D.RenderTarget.DrawBitmap

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap*">DrawBitmap Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_C1_Util_DX_Direct2D_Bitmap_System_Single_C1_Util_DX_Direct2D_BitmapInterpolationMode_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap(C1.Util.DX.Direct2D.Bitmap,System.Single,C1.Util.DX.Direct2D.BitmapInterpolationMode)">DrawBitmap(Bitmap, float, BitmapInterpolationMode)</h4>
<div class="markdown level1 summary"><p>Draws the specified bitmap after scaling it to the size of the specified rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawBitmap(Bitmap bitmap, float opacity, BitmapInterpolationMode interpolationMode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawBitmap(bitmap As Bitmap, opacity As Single, interpolationMode As BitmapInterpolationMode)</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.Bitmap.html">Bitmap</a></td>
      <td><span class="parametername">bitmap</span></td>
      <td><p>The bitmap to render.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">opacity</span></td>
      <td><p>A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents.  The default value is 1.0f.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapInterpolationMode.html">BitmapInterpolationMode</a></td>
      <td><span class="parametername">interpolationMode</span></td>
      <td><p>The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is <span class="xref">C1.Win.DX.Direct2D.BitmapInterpolationMode.Linear</span>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_C1_Util_DX_Direct2D_Bitmap_C1_Util_DX_RectF_System_Single_C1_Util_DX_Direct2D_BitmapInterpolationMode_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap(C1.Util.DX.Direct2D.Bitmap,C1.Util.DX.RectF,System.Single,C1.Util.DX.Direct2D.BitmapInterpolationMode)">DrawBitmap(Bitmap, RectF, float, BitmapInterpolationMode)</h4>
<div class="markdown level1 summary"><p>Draws the specified bitmap after scaling it to the size of the specified rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawBitmap(Bitmap bitmap, RectF destinationRectangle, float opacity = 1, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.Linear)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawBitmap(bitmap As Bitmap, destinationRectangle As RectF, Optional opacity As Single = 1, Optional interpolationMode As BitmapInterpolationMode = BitmapInterpolationMode.Linear)</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.Bitmap.html">Bitmap</a></td>
      <td><span class="parametername">bitmap</span></td>
      <td><p>The bitmap to render.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectF.html">RectF</a></td>
      <td><span class="parametername">destinationRectangle</span></td>
      <td><p>The size and position, in device-independent pixels in the render target's coordinate space, of the area to which the bitmap is drawn; NULL to draw the selected portion of the bitmap at the origin of the render target.  If the rectangle is specified but not well-ordered, nothing is drawn, but the render target does not enter an error state.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">opacity</span></td>
      <td><p>A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents.  The default value is 1.0f.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapInterpolationMode.html">BitmapInterpolationMode</a></td>
      <td><span class="parametername">interpolationMode</span></td>
      <td><p>The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is <a class="xref" href="C1.Util.DX.Direct2D.BitmapInterpolationMode.html#C1_Util_DX_Direct2D_BitmapInterpolationMode_Linear">Linear</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_C1_Util_DX_Direct2D_Bitmap_System_Single_C1_Util_DX_Direct2D_BitmapInterpolationMode_C1_Util_DX_RectF_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap(C1.Util.DX.Direct2D.Bitmap,System.Single,C1.Util.DX.Direct2D.BitmapInterpolationMode,C1.Util.DX.RectF)">DrawBitmap(Bitmap, float, BitmapInterpolationMode, RectF)</h4>
<div class="markdown level1 summary"><p>Draws the specified bitmap after scaling it to the size of the specified rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawBitmap(Bitmap bitmap, float opacity, BitmapInterpolationMode interpolationMode, RectF sourceRectangle)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawBitmap(bitmap As Bitmap, opacity As Single, interpolationMode As BitmapInterpolationMode, sourceRectangle As RectF)</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.Bitmap.html">Bitmap</a></td>
      <td><span class="parametername">bitmap</span></td>
      <td><p>The bitmap to render.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">opacity</span></td>
      <td><p>A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents.  The default value is 1.0f.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapInterpolationMode.html">BitmapInterpolationMode</a></td>
      <td><span class="parametername">interpolationMode</span></td>
      <td><p>The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is <span class="xref">C1.Win.DX.Direct2D.BitmapInterpolationMode.Linear</span>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectF.html">RectF</a></td>
      <td><span class="parametername">sourceRectangle</span></td>
      <td><p>The size and position, in device-independent pixels in the bitmap's coordinate space, of the area within the bitmap to be drawn; NULL to draw the entire bitmap.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap*"></a>
<h4 id="C1_Util_DX_Direct2D_RenderTarget_DrawBitmap_C1_Util_DX_Direct2D_Bitmap_System_Nullable_C1_Util_DX_RectF__System_Single_C1_Util_DX_Direct2D_BitmapInterpolationMode_System_Nullable_C1_Util_DX_RectF__" data-uid="C1.Util.DX.Direct2D.RenderTarget.DrawBitmap(C1.Util.DX.Direct2D.Bitmap,System.Nullable{C1.Util.DX.RectF},System.Single,C1.Util.DX.Direct2D.BitmapInterpolationMode,System.Nullable{C1.Util.DX.RectF})">DrawBitmap(Bitmap, RectF?, float, BitmapInterpolationMode, RectF?)</h4>
<div class="markdown level1 summary"><p>void ID2D1RenderTarget::DrawBitmap([In] ID2D1Bitmap* bitmap,[In, Optional] const D2D_RECT_F* destinationRectangle,[In] float opacity,[In] D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,[In, Optional] const D2D_RECT_F* sourceRectangle)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawBitmap(Bitmap bitmap, RectF? destinationRectangle, float opacity, BitmapInterpolationMode interpolationMode, RectF? sourceRectangle)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawBitmap(bitmap As Bitmap, destinationRectangle As RectF?, opacity As Single, interpolationMode As BitmapInterpolationMode, sourceRectangle As RectF?)</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.Bitmap.html">Bitmap</a></td>
      <td><span class="parametername">bitmap</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectF.html">RectF</a>?</td>
      <td><span class="parametername">destinationRectangle</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">opacity</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BitmapInterpolationMode.html">BitmapInterpolationMode</a></td>
      <td><span class="parametername">interpolationMode</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.RectF.html">RectF</a>?</td>
      <td><span class="parametername">sourceRectangle</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
