# C1.Util.DX.Direct2D.Effects.ConvolveMatrix

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix" class="text-break">ConvolveMatrix Class
</h1>
  <div class="markdown level0 summary"><p>Builtin ConvolveMatrix effect.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="C1.Util.DX.DisposeBase.html">DisposeBase</a></div>
    <div class="level2"><a class="xref" href="C1.Util.DX.CppObject.html">CppObject</a></div>
    <div class="level3"><a class="xref" href="C1.Util.DX.ComObject.html">ComObject</a></div>
    <div class="level4"><a class="xref" href="C1.Util.DX.Direct2D.Properties.html">Properties</a></div>
    <div class="level5"><a class="xref" href="C1.Util.DX.Direct2D.Effect.html">Effect</a></div>
    <div class="level6"><span class="xref">ConvolveMatrix</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="C1.Util.DX.IUnknown.html">IUnknown</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Util.DX.Direct2D.Effects.html">C1.Util.DX.Direct2D.Effects</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.DX.4.6.2.dll</h6>
  <h5 id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ConvolveMatrix : Effect, IDisposable, IUnknown</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class ConvolveMatrix
    Inherits Effect
    Implements IDisposable, IUnknown</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix__ctor_System_IntPtr_" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.#ctor(System.IntPtr)">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.-ctor.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix__ctor_System_IntPtr_">ConvolveMatrix(IntPtr)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.html">ConvolveMatrix</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Bias" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Bias">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Bias.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Bias">Bias</a>
        </td>
        <td class="markdown level1 summary"><p>The effect applies the kernel matrix, the divisor, and then the bias is added to the result. The bias is unbounded and unitless.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_BorderMode" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.BorderMode">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.BorderMode.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_BorderMode">BorderMode</a>
        </td>
        <td class="markdown level1 summary"><p>The mode used to calculate the border of the image, soft or hard. See <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.BorderMode.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_BorderMode">BorderMode</a> modes for more info.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_ClampOutput" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.ClampOutput">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.ClampOutput.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_ClampOutput">ClampOutput</a>
        </td>
        <td class="markdown level1 summary"><p>Whether the effect clamps color values to between 0 and 1 before the effect passes the values to the next effect in the graph. The effect clamps the values before it premultiplies the alpha .
if you set this to TRUE the effect will clamp the values.
If you set this to FALSE, the effect will not clamp the color values, but other effects and the output surface may clamp the values if they are not of high enough precision.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Divisor" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Divisor">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Divisor.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Divisor">Divisor</a>
        </td>
        <td class="markdown level1 summary"><p>The kernel matrix is applied to a pixel and then the result is divided by this value. 0 behaves as a value of float epsilon.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelMatrix" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelMatrix">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelMatrix.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelMatrix">KernelMatrix</a>
        </td>
        <td class="markdown level1 summary"><p>The kernel matrix to be applied to the image. The kernel elements aren't bounded and are specified as floats.
The first set of KernelSizeX numbers in the FLOAT[] corresponds to the first row in the kernel.
The second set of KernelSizeX numbers correspond to the second row, and so on up to KernelSizeY rows.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelOffset" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelOffset">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelOffset.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelOffset">KernelOffset</a>
        </td>
        <td class="markdown level1 summary"><p>Shifts the convolution kernel from a centered position on the output pixel to a position you specify left/right and up/down. The offset is defined in kernel units.
With some offsets and kernel sizes, the convolution kernel’s samples won't land on a pixel image center. The pixel values for the kernel sample are computed by bilinear interpolation.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelSizeX" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelSizeX">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelSizeX.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelSizeX">KernelSizeX</a>
        </td>
        <td class="markdown level1 summary"><p>The width of the kernel matrix. The units are specified in kernel units.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelSizeY" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelSizeY">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelSizeY.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelSizeY">KernelSizeY</a>
        </td>
        <td class="markdown level1 summary"><p>The height of the kernel matrix. The units are specified in kernel units.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelUnitLength" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelUnitLength">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.KernelUnitLength.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_KernelUnitLength">KernelUnitLength</a>
        </td>
        <td class="markdown level1 summary"><p>The size of one unit in the kernel. The units are in (DIPs/kernel unit), where a kernel unit is the size of the element in the convolution kernel. A value of 1 (DIP/kernel unit) corresponds to one pixel in a image at 96 DPI.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_PreserveAlpha" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.PreserveAlpha">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.PreserveAlpha.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_PreserveAlpha">PreserveAlpha</a>
        </td>
        <td class="markdown level1 summary"><p>Specifies whether the convolution kernel is applied to the alpha channel or only the color channels.
If you set this to TRUE the convolution kernel is applied only to the color channels.
If you set this to FALSE the convolution kernel is applied to all channels.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_ScaleMode" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.ScaleMode">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.ScaleMode.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_ScaleMode">ScaleMode</a>
        </td>
        <td class="markdown level1 summary"><p>The interpolation mode the effect uses to scale the image to the corresponding kernel unit length. There are six scale modes that range in quality and speed. If you don't select a mode, the effect uses the interpolation mode of the device context. See Scale modes for more info</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Create_C1_Util_DX_Direct2D_DeviceContext_" data-uid="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Create(C1.Util.DX.Direct2D.DeviceContext)">
          <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.Create.html#C1_Util_DX_Direct2D_Effects_ConvolveMatrix_Create_C1_Util_DX_Direct2D_DeviceContext_">Create(DeviceContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of <a class="xref" href="C1.Util.DX.Direct2D.Effects.ConvolveMatrix.html">ConvolveMatrix</a> effect.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
