# C1.Win.Util.ImageRecolorer.BlendOverBackground

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Util_ImageRecolorer_BlendOverBackground_" data-uid="C1.Win.Util.ImageRecolorer.BlendOverBackground*">BlendOverBackground Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Util_ImageRecolorer_BlendOverBackground_" data-uid="C1.Win.Util.ImageRecolorer.BlendOverBackground*"></a>
<h4 id="C1_Win_Util_ImageRecolorer_BlendOverBackground_System_Drawing_Bitmap_System_Drawing_Color_System_Drawing_Color_" data-uid="C1.Win.Util.ImageRecolorer.BlendOverBackground(System.Drawing.Bitmap,System.Drawing.Color,System.Drawing.Color)">BlendOverBackground(Bitmap, Color, Color)</h4>
<div class="markdown level1 summary"><p>Blends only the pixels matching the given <code class="paramref">targetColor</code> against a specified
<code class="paramref">background</code> color, preserving all other pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap BlendOverBackground(Bitmap srcImage, Color targetColor, Color background)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function BlendOverBackground(srcImage As Bitmap, targetColor As Color, background As Color) As Bitmap</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="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a></td>
      <td><span class="parametername">srcImage</span></td>
      <td><p>The source bitmap with alpha channel (must be Format32bppPArgb).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">targetColor</span></td>
      <td><p>The color to match.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">background</span></td>
      <td><p>The background color to blend the transparent pixels against</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="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a></td>
      <td><p>A 32bpp image</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>Thrown if the source bitmap is not in a supported 32bpp PARGB format.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
