コード例 #1
0
        public Brush CreateBrush(GaugeVisualElement owner, GaugeBrushType type)
        {
            LinearGaugeBar bar = owner as LinearGaugeBar;

            if (bar == null)
            {
                return((Brush)null);
            }
            switch (type)
            {
            case GaugeBrushType.Other:
                return((Brush)null);

            case GaugeBrushType.Rainbow:
            case GaugeBrushType.Rainbow2:
            case GaugeBrushType.Rainbow3:
                return(this.CreateRainbowBrush(bar));

            case GaugeBrushType.Gradient:
                if (bar.BackColor == bar.BackColor2)
                {
                    return((Brush) new SolidBrush(bar.BackColor));
                }
                return((Brush) new LinearGradientBrush(bar.Path.GetBounds(), bar.BackColor, bar.BackColor2, 90f));

            default:
                return((Brush)null);
            }
        }
コード例 #2
0
ファイル: BrushFactory.cs プロジェクト: RichardHaggard/BDC
        public Brush CreateBrush(GaugeVisualElement owner, GaugeBrushType type)
        {
            RadialGaugeArc owner1 = owner as RadialGaugeArc;

            if (owner1 == null)
            {
                return((Brush)null);
            }
            switch (type)
            {
            case GaugeBrushType.Rainbow:
                return(this.CreateRainbowBrush(owner1));

            case GaugeBrushType.Rainbow2:
                return(this.CreateRainbow2Brush(owner1));

            case GaugeBrushType.Rainbow3:
                return(this.CreateRainbow3Brush(owner1));

            case GaugeBrushType.Gradient:
                return(this.CreateGradientBrush(owner1));

            default:
                return(this.CreateRainbowBrush(owner1));
            }
        }
コード例 #3
0
 public GaugeShape(GaugeVisualElement owner)
 {
     this.owner = owner;
 }