Example #1
0
        protected virtual void DrawBar(string value, ImageRenderer render)
        {
            Bar   drawBar = GaugeSettings.GetBar();
            float min     = ModelDisplayText.GetNumValue(GaugeSettings.MinimumValue, 0);
            float max     = ModelDisplayText.GetNumValue(GaugeSettings.MaximumValue, 100);

            render.Rotate(GaugeSettings.BarOrientation, new PointF(0, 0));
            render.DrawBar(ColorTranslator.FromHtml(GaugeSettings.GaugeColor), drawBar);

            if (GaugeSettings.DrawWarnRange)
            {
                render.DrawBarRanges(drawBar, GaugeSettings.GetColorRange(), GaugeSettings.GetWarnRange(), min, max, GaugeSettings.SymmRange);
            }

            if (GaugeSettings.CenterLine)
            {
                render.DrawBarCenterLine(drawBar, ColorTranslator.FromHtml(GaugeSettings.CenterLineColor), ModelDisplayText.GetNumValue(GaugeSettings.CenterLineThickness, 2));
            }

            render.DrawBarIndicator(drawBar, ColorTranslator.FromHtml(GaugeSettings.IndicatorColor), ModelDisplayText.GetNumValue(GaugeSettings.IndicatorSize, 10), ModelDisplayText.GetNumValue(value, 0), min, max, GaugeSettings.IndicatorFlip);
        }