📄 elementpanelstyle.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Xml;
public class ElementPanelStyle : EStyleBase
{
public Bitmap _backgroundB;
public Bitmap _backgroundBL;
public Bitmap _backgroundBR;
public Bitmap _backgroundC;
public Bitmap _backgroundL;
public Bitmap _backgroundR;
public Bitmap _backgroundT;
public Bitmap _backgroundTL;
public Bitmap _backgroundTR;
public EAlignment _horAlignment;
public System.Drawing.Point _location;
public int _paddingBottom;
public int _paddingLeft;
public int _paddingRight;
public int _paddingTop;
protected Dictionary<string, Rectangle> _positions;
public Size _size;
private RGB _transParentColor;
public EAlignment _verAlignment;
public EAlignment _xAlignment;
public EAlignment _yAlignment;
public override void ChangeColor(int hue, double sat, double lum)
{
if (this.TransParentColor != null)
{
HSLFilter.ChangeImageColor(ref this._backgroundT, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundTL, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundTR, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundB, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundBL, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundBR, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundL, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundC, hue, sat, lum, this.TransParentColor);
HSLFilter.ChangeImageColor(ref this._backgroundR, hue, sat, lum, this.TransParentColor);
base.ChangeColor(hue, sat, lum);
}
}
public override void Dispose()
{
base.Dispose();
this._location = System.Drawing.Point.Empty;
this._size = Size.Empty;
this._positions = null;
this._xAlignment = EAlignment.left;
this._yAlignment = EAlignment.top;
this._horAlignment = EAlignment.left;
this._verAlignment = EAlignment.top;
this._backgroundT = null;
this._backgroundTL = null;
this._backgroundTR = null;
this._backgroundB = null;
this._backgroundBL = null;
this._backgroundBR = null;
this._backgroundL = null;
this._backgroundC = null;
this._backgroundR = null;
this._paddingLeft = 0;
this._paddingTop = 0;
this._paddingRight = 0;
this._paddingBottom = 0;
this._transParentColor = null;
}
protected override void LoadStyle(XmlElement elem)
{
base.LoadStyle(elem);
this._location.X = base.GetIntegerAttribute(elem, "left");
this._location.Y = base.GetIntegerAttribute(elem, "top");
this._size.Width = base.GetIntegerAttribute(elem, "width");
this._size.Height = base.GetIntegerAttribute(elem, "height");
this._xAlignment = EStyleBase.AlignmentStringToValue(base.GetStringAttribute(elem, "xAlignment"), EAlignment.left);
this._yAlignment = EStyleBase.AlignmentStringToValue(base.GetStringAttribute(elem, "yAlignment"), EAlignment.top);
this._horAlignment = EStyleBase.AlignmentStringToValue(base.GetStringAttribute(elem, "horizontalAlignment"), EAlignment.left);
this._verAlignment = EStyleBase.AlignmentStringToValue(base.GetStringAttribute(elem, "virticalAlignment"), EAlignment.top);
this._backgroundT = base.GetImageAttribute(elem, "backgroundT");
this._backgroundTL = base.GetImageAttribute(elem, "backgroundTL");
this._backgroundTR = base.GetImageAttribute(elem, "backgroundTR");
this._backgroundB = base.GetImageAttribute(elem, "backgroundB");
this._backgroundBL = base.GetImageAttribute(elem, "backgroundBL");
this._backgroundBR = base.GetImageAttribute(elem, "backgroundBR");
this._backgroundL = base.GetImageAttribute(elem, "backgroundL");
this._backgroundC = base.GetImageAttribute(elem, "backgroundC");
this._backgroundR = base.GetImageAttribute(elem, "backgroundR");
this._paddingLeft = base.GetIntegerAttribute(elem, "paddingLeft");
this._paddingTop = base.GetIntegerAttribute(elem, "paddingTop");
this._paddingRight = base.GetIntegerAttribute(elem, "paddingRight");
this._paddingBottom = base.GetIntegerAttribute(elem, "paddingBottom");
this.TransParentColor = base.GetRGBAttribute(elem, "transColor");
foreach (XmlNode node in elem.ChildNodes)
{
XmlElement element = node as XmlElement;
if (element.Name == "Position")
{
string stringAttribute = base.GetStringAttribute(element, "event");
Rectangle rectangle = new Rectangle(base.GetIntegerAttribute(element, "left"), base.GetIntegerAttribute(element, "top"), base.GetIntegerAttribute(element, "width"), base.GetIntegerAttribute(element, "height"));
try
{
this.Positions.Add(stringAttribute, rectangle);
continue;
}
catch
{
continue;
}
}
}
}
public Dictionary<string, Rectangle> Positions
{
get
{
if (this._positions == null)
{
this._positions = new Dictionary<string, Rectangle>();
}
return this._positions;
}
}
internal RGB TransParentColor
{
get
{
return this._transParentColor;
}
set
{
this._transParentColor = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -