[]
        
(Showing Draft Content)

C1.Framework.BlendConverter

BlendConverter Class

TypeConverter that converts Blend objects to and from strings.

Inheritance
BlendConverter
Namespace: C1.Framework
Assembly: C1.Win.4.8.dll
Syntax
public class BlendConverter : TypeConverter
Remarks

The 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 Blend objects to Xml.

Examples

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.

Constructors

Name Description
BlendConverter()

Methods

Name Description
CanConvertFrom(ITypeDescriptorContext, Type)
CanConvertTo(ITypeDescriptorContext, Type)
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
GetCreateInstanceSupported(ITypeDescriptorContext)