public UIAnalogMeter() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.DoubleBuffer, true); base.DoubleBuffered = true; // Properties initialization needleColor = Color.Yellow; scaleColor = Color.White; meterStyle = AnalogMeterStyle.Circular; viewGlass = false; startAngle = 135; endAngle = 405; minValue = 0; maxValue = 100; currValue = 0; scaleDivisions = 11; scaleSubDivisions = 4; renderer = null; // Set the styles for drawing SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); // Create the default renderer defaultRenderer = new LBDefaultAnalogMeterRenderer(); defaultRenderer.AnalogMeter = this; Width = Height = 180; }
public HMIAnlogMeter() { // 控件初始化 InitializeComponent(); // 属性初始化 this.bodyColor = Color.MidnightBlue; this.needleColor = Color.White; this.scaleColor = Color.White; this.unNorColor = Color.Red; this.meterStyle = AnalogMeterStyle.Circular; this.viewGlass = false; this.startAngle = 135; this.endAngle = 405; this.minValue = 0; this.maxValue = 1; this.minNorValue = 0; this.maxNorValue = 1; this.currValue = 0; this.scaleDivisions = 11; this.scaleSubDivisions = 10; // 刻度值列表 this.listThreshold = new MeterThresholdCollection(); this.CalculateDimensions(); }
/// <summary> /// Initializes a new instance of the <see cref="ZeroitAnalogMeter"/> class. /// </summary> public ZeroitAnalogMeter() { // Initialization InitializeComponent(); // Properties initialization this.bodyColor = Color.Red; this.needleColor = Color.Yellow; this.scaleColor = Color.White; this.meterStyle = AnalogMeterStyle.Circular; this.viewGlass = false; this.startAngle = 135; this.endAngle = 405; this.minValue = 0; this.maxValue = 1; this.currValue = 0; this.scaleDivisions = 10; this.scaleSubDivisions = 10; this.renderer = null; // Set the styles for drawing this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); // Create the default renderer this.defaultRenderer = new LBDefaultAnalogMeterRenderer(); this.defaultRenderer.AnalogMeter = this; // Create the default renderer this.customRenderer = new LBCustomAnalogMeterRenderer(); this.customRenderer.AnalogMeter = this; }
public LBAnalogMeter() { // Initialization InitializeComponent(); // Properties initialization this.bodyColor = Color.Red; this.needleColor = Color.Yellow; this.scaleColor = Color.White; this.meterStyle = AnalogMeterStyle.Circular; this.viewGlass = true; this.startAngle = 135; this.endAngle = 405; this.minValue = 0; this.maxValue = 1; this.currValue = 0; this.scaleDivisions = 11; this.scaleSubDivisions = 4; this.renderer = null; // Create the sector list this.listThreshold = new LBMeterThresholdCollection(); // Set the styles for drawing SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); // Transparent background this.BackColor = Color.Transparent; // Create the default renderer this.defaultRenderer = new LBAnalogMeterRenderer(); this.defaultRenderer.AnalogMeter = this; this.CalculateDimensions(); }
public LBAnalogMeter() { // Initialization InitializeComponent(); // Properties initialization this.bodyColor = Color.Red; this.needleColor = Color.Yellow; this.scaleColor = Color.White; this.meterStyle = AnalogMeterStyle.Circular; this.viewGlass = false; this.startAngle = 135; this.endAngle = 405; this.minValue = 0; this.maxValue = 1; this.currValue = 0; this.scaleDivisions = 10; this.scaleSubDivisions = 10; // Create the sector list this.listThreshold = new LBMeterThresholdCollection(); this.CalculateDimensions(); }