Ejemplo n.º 1
0
        protected virtual void RenderDefaultImage(ImageManager imgManager)
        {
            ImageRenderer render = new ImageRenderer(imgManager.GetImageObject(GaugeSettings.DefaultImage, DeckType));

            if (GaugeSettings.DrawArc)
            {
                render.DrawArc(GaugeSettings.GetArc(), ColorTranslator.FromHtml(GaugeSettings.GaugeColor));
            }
            else
            {
                render.Rotate(GaugeSettings.BarOrientation, new PointF(0, 0));
                render.DrawBar(ColorTranslator.FromHtml(GaugeSettings.GaugeColor), GaugeSettings.GetBar());
            }

            DefaultImageRender = render.RenderImage64();
            render.Dispose();
        }
Ejemplo n.º 2
0
        protected virtual void DrawArc(string value, ImageRenderer render)
        {
            Arc   drawArc = GaugeSettings.GetArc();
            float min     = ModelDisplayText.GetNumValue(GaugeSettings.MinimumValue, 0);
            float max     = ModelDisplayText.GetNumValue(GaugeSettings.MaximumValue, 100);

            render.DrawArc(drawArc, ColorTranslator.FromHtml(GaugeSettings.GaugeColor));

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

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

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