CreateSteppedGradientBrush() public static method

Creates a 'stepped' gradient brush from a list of colors.
public static CreateSteppedGradientBrush ( IList colors, bool horizontal = true ) : System.Windows.Media.LinearGradientBrush
colors IList The colors.
horizontal bool if set to true [horizontal].
return System.Windows.Media.LinearGradientBrush
示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SlopeTexture"/> class.
 /// </summary>
 /// <param name="gradientSteps">
 /// The gradient steps.
 /// </param>
 public SlopeTexture(int gradientSteps)
 {
     if (gradientSteps > 0)
     {
         this.Brush = BrushHelper.CreateSteppedGradientBrush(GradientBrushes.BlueWhiteRed, gradientSteps);
     }
     else
     {
         this.Brush = GradientBrushes.BlueWhiteRed;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SlopeDirectionTexture"/> class.
 /// </summary>
 /// <param name="gradientSteps">
 /// The gradient steps.
 /// </param>
 public SlopeDirectionTexture(int gradientSteps)
 {
     if (gradientSteps > 0)
     {
         this.Brush = BrushHelper.CreateSteppedGradientBrush(GradientBrushes.Hue, gradientSteps);
     }
     else
     {
         this.Brush = GradientBrushes.Hue;
     }
 }