Esempio n. 1
0
        public override bool DrawNeedleCover(Graphics Gr, RectangleF rc)
        {
            if (this.AnalogMeter == null)
            {
                return(false);
            }

            Color      clr       = this.AnalogMeter.NeedleColor;
            RectangleF _rc       = rc;
            float      drawRatio = this.AnalogMeter.GetDrawRatio();

            Color clr1 = Color.FromArgb(70, clr);

            _rc.Inflate(5 * drawRatio, 5 * drawRatio);

            SolidBrush brTransp = new SolidBrush(clr1);

            Gr.FillEllipse(brTransp, _rc);

            clr1 = clr;
            Color clr2 = LBColorManager.StepColor(clr, 75);
            LinearGradientBrush br1 = new LinearGradientBrush(rc,
                                                              clr1,
                                                              clr2,
                                                              45);

            Gr.FillEllipse(br1, rc);
            return(true);
        }
Esempio n. 2
0
        public override bool DrawBody(Graphics Gr, RectangleF rc)
        {
            if (this.AnalogMeter == null)
            {
                return(false);
            }

            Color bodyColor = this.AnalogMeter.BodyColor;
            Color cDark     = LBColorManager.StepColor(bodyColor, 20);

            LinearGradientBrush br1 = new LinearGradientBrush(rc,
                                                              bodyColor,
                                                              cDark,
                                                              45);

            Gr.FillEllipse(br1, rc);

            float drawRatio = this.AnalogMeter.GetDrawRatio();

            RectangleF _rc = rc;

            _rc.X      += 3 * drawRatio;
            _rc.Y      += 3 * drawRatio;
            _rc.Width  -= 6 * drawRatio;
            _rc.Height -= 6 * drawRatio;

            LinearGradientBrush br2 = new LinearGradientBrush(_rc,
                                                              cDark,
                                                              bodyColor,
                                                              45);

            Gr.FillEllipse(br2, _rc);

            return(true);
        }