The following picture shows two linear gauges with applied gel effect. The difference is in the margins and corner rounding of the gel effect:
The following code shows how to apply a gel effect to a panel with altered default settings:
C# |
Copy Code
|
---|---|
nChartControl1.Panels.Clear(); NNumericDisplayPanel displayPanel = new NNumericDisplayPanel(); displayPanel.BorderStyle = new NEdgeBorderStyle(); displayPanel.BackgroundFillStyle = new NColorFillStyle(Color.Black); displayPanel.Margins = new NMarginsL(10, 10, 10, 10); displayPanel.Padding = new NMarginsL(10, 10, 10, 10); displayPanel.Value = 12345.67; NGelEffectStyle gelEffect = new NGelEffectStyle(); gelEffect.Margins = new NMarginsL(new NLength(3), new NLength(3), new NLength(3), new NLength(60, NRelativeUnit.ParentPercentage)); gelEffect.CornerRounding = new NLength(10); gelEffect.BeginColor = Color.FromArgb(125, Color.White); gelEffect.EndColor = Color.FromArgb(30, Color.White); displayPanel.PaintEffect = gelEffect; nChartControl1.Panels.Add(displayPanel); |
Visual Basic |
Copy Code
|
---|---|
nChartControl1.Panels.Clear() Dim displayPanel As New NNumericDisplayPanel() displayPanel.BorderStyle = New NEdgeBorderStyle()displayPanel.BackgroundFillStyle = New NColorFillStyle(Color.Black)displayPanel.Margins = New NMarginsL(10, 10, 10, 10) displayPanel.Padding = New NMarginsL(10, 10, 10, 10) displayPanel.Value = 12345.67 Dim gelEffect As New NGelEffectStyle() gelEffect.Margins = New NMarginsL(New NLength(3), New NLength(3), New NLength(3), New NLength(60, NRelativeUnit.ParentPercentage))gelEffect.CornerRounding = New NLength(10) gelEffect.BeginColor = Color.FromArgb(125, Color.White) gelEffect.EndColor = Color.FromArgb(30, Color.White) displayPanel.PaintEffect = gelEffect NChartControl1.Panels.Add(displayPanel) |