Ejemplo n.º 1
0
        private NGaugeBackgroundAdorner CreateBackgroundAdorner()
        {
            GaugeBackroundAdornerShape shape = (GaugeBackroundAdornerShape)AdornerShapeComboBox.SelectedIndex;

            if (LeftMarginComboBox.SelectedItem == null ||
                TopMarginComboBox.SelectedItem == null ||
                RightMarginComboBox.SelectedItem == null ||
                BottomMarginComboBox.SelectedItem == null)
            {
                return(null);
            }

            NMarginsL margins = new NMarginsL(new NLength((int)LeftMarginComboBox.SelectedItem, NRelativeUnit.ParentPercentage),
                                              new NLength((int)TopMarginComboBox.SelectedItem, NRelativeUnit.ParentPercentage),
                                              new NLength((int)RightMarginComboBox.SelectedItem, NRelativeUnit.ParentPercentage),
                                              new NLength((int)BottomMarginComboBox.SelectedItem, NRelativeUnit.ParentPercentage));

            NGaugeBackgroundAdorner adorner = new NGaugeBackgroundAdorner();

            adorner.FillStyle = new NGradientFillStyle(Color.FromArgb(0, Color.Black), Color.FromArgb(120, Color.LightGreen));
            adorner.Shape     = shape;
            adorner.Margins   = margins;

            return(adorner);
        }
Ejemplo n.º 2
0
        private void UpdateEffects()
        {
            if (m_LinearGauge == null || m_RadialGauge == null)
            {
                return;
            }

            NGaugeBackgroundAdorner adorner = CreateBackgroundAdorner();

            if (adorner != null)
            {
                m_LinearGauge.BackgroundAdorner = adorner;
                m_RadialGauge.BackgroundAdorner = adorner;
            }

            nChartControl1.Refresh();
        }