public void lightOn() { this._color = Color.FromArgb(255, this._color.R, this._color.G, this._color.B); CoolerMasterDLL.SetLedColor(this._row - 1, this._column - 1, this._color.R, this._color.G, this._color.B); if (this._autoDimToBgColor) { //if (dimmerTimer != null) { // dimmerTimer.Stop(); // dimmerTimer = null; //} lightDim(); } }
private void dimmerTimerEventProcessor(Object myObject, EventArgs myEventArgs) { int alphaStep = 255 / 8; if (this._color.A > 0) { int newAlpha = this._color.A - alphaStep; if (newAlpha < 0) { newAlpha = 0; } this._color = Color.FromArgb(newAlpha, this._color.R, this._color.G, this._color.B); Color nColor = CalculateSolidColorFromTransparentColor(this._color, this._bgColor); CoolerMasterDLL.SetLedColor(this._row - 1, this._column - 1, nColor.R, nColor.G, nColor.B); } else { timer.detachEventHandler(eventHandler); //dimmerTimer.Stop(); //dimmerTimer = null; } }
public void lightOff() { CoolerMasterDLL.SetLedColor(this._row - 1, this._column - 1, Color.Black.R, Color.Black.G, Color.Black.B); }