# C1.Framework.BlendConverter

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Framework_BlendConverter" data-uid="C1.Framework.BlendConverter" class="text-break">BlendConverter Class
</h1>
  <div class="markdown level0 summary"><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.typeconverter">TypeConverter</a> that converts <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.drawing2d.blend">Blend</a> objects to and from strings.</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="https://learn.microsoft.com/dotnet/api/system.componentmodel.typeconverter">TypeConverter</a></div>
    <div class="level2"><span class="xref">BlendConverter</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Framework.html">C1.Framework</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.10.dll</h6>
  <h5 id="C1_Framework_BlendConverter_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class BlendConverter : TypeConverter</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class BlendConverter
    Inherits TypeConverter</code></pre>
  </div>
  <h5 id="C1_Framework_BlendConverter_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.drawing2d.blend">Blend</a> object is converted to a string with the following format:</p>
<p>[p1],[f1];[p2],[f2];...;[pn],[fn]</p>
<p>Where the 'pi' are positions between 0 and 1 along the blend line and
'fi' are factors between 0 and 1 that correspond to the amount of the 
secondary color in the blend.</p>
<p>The positions must be increasing, and the last one must be 1.</p>
<p>This converter allows persisting <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.drawing2d.blend">Blend</a> objects to Xml.</p>
</div>
  <h5 id="C1_Framework_BlendConverter_examples"><strong>Examples</strong></h5>
  <p>These are some simple blend strings:</p>
<p>"0,0;1,1": default blend, starting with color1 (0,0) and finishing with color2 (1,1).</p>
<p>"0,1;1,0": reverse blend, starting with color2 (1,0) and finishing with color1 (0,1).</p>
<p>"0,0;.5,1;1,0": starts with color1, switches to color2 halfway, then back to color1.</p>
<p>"0,0;.1,1;.9,1;1,0": starts with color1, switches to color2 at 10%, continues with color2 up to 90%, then switches back to color1.</p>

  <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_Framework_BlendConverter__ctor" data-uid="C1.Framework.BlendConverter.#ctor">
          <a class="xref" href="C1.Framework.BlendConverter.-ctor.html#C1_Framework_BlendConverter__ctor">BlendConverter()</a>
        </td>
        <td class="markdown level1 summary"></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_Framework_BlendConverter_CanConvertFrom_System_ComponentModel_ITypeDescriptorContext_System_Type_" data-uid="C1.Framework.BlendConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Type)">
          <a class="xref" href="C1.Framework.BlendConverter.CanConvertFrom.html#C1_Framework_BlendConverter_CanConvertFrom_System_ComponentModel_ITypeDescriptorContext_System_Type_">CanConvertFrom(ITypeDescriptorContext, Type)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Framework_BlendConverter_CanConvertTo_System_ComponentModel_ITypeDescriptorContext_System_Type_" data-uid="C1.Framework.BlendConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Type)">
          <a class="xref" href="C1.Framework.BlendConverter.CanConvertTo.html#C1_Framework_BlendConverter_CanConvertTo_System_ComponentModel_ITypeDescriptorContext_System_Type_">CanConvertTo(ITypeDescriptorContext, Type)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Framework_BlendConverter_ConvertFrom_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_" data-uid="C1.Framework.BlendConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)">
          <a class="xref" href="C1.Framework.BlendConverter.ConvertFrom.html#C1_Framework_BlendConverter_ConvertFrom_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_">ConvertFrom(ITypeDescriptorContext, CultureInfo, object)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Framework_BlendConverter_ConvertTo_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_System_Type_" data-uid="C1.Framework.BlendConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)">
          <a class="xref" href="C1.Framework.BlendConverter.ConvertTo.html#C1_Framework_BlendConverter_ConvertTo_System_ComponentModel_ITypeDescriptorContext_System_Globalization_CultureInfo_System_Object_System_Type_">ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Framework_BlendConverter_GetCreateInstanceSupported_System_ComponentModel_ITypeDescriptorContext_" data-uid="C1.Framework.BlendConverter.GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext)">
          <a class="xref" href="C1.Framework.BlendConverter.GetCreateInstanceSupported.html#C1_Framework_BlendConverter_GetCreateInstanceSupported_System_ComponentModel_ITypeDescriptorContext_">GetCreateInstanceSupported(ITypeDescriptorContext)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>

</div>
