Input for WinForms | ComponentOne
C1.Framework Namespace / BlendConverter Class
Members

In This Topic
    BlendConverter Class
    In This Topic
    System.ComponentModel.TypeConverter that converts System.Drawing.Drawing2D.Blend objects to and from strings.
    Syntax
    'Declaration
     
    
    Public Class BlendConverter 
       Inherits System.ComponentModel.TypeConverter
    public class BlendConverter : System.ComponentModel.TypeConverter 
    Remarks

    The System.Drawing.Drawing2D.Blend object is converted to a string with the following format:

    [p1],[f1];[p2],[f2];...;[pn],[fn]

    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.

    The positions must be increasing, and the last one must be 1.

    This converter allows persisting System.Drawing.Drawing2D.Blend objects to Xml.

    Example
    These are some simple blend strings:

    "0,0;1,1": default blend, starting with color1 (0,0) and finishing with color2 (1,1).

    "0,1;1,0": reverse blend, starting with color2 (1,0) and finishing with color1 (0,1).

    "0,0;.5,1;1,0": starts with color1, switches to color2 halfway, then back to color1.

    "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.

    Inheritance Hierarchy

    System.Object
       System.ComponentModel.TypeConverter
          C1.Framework.BlendConverter

    See Also