📄 ximformstyle.cs
字号:
namespace Imps.Client.Pc.BizControls
{
using Imps.Client.Pc.Theme;
using Imps.Client.Pc.XControlStyle;
using Imps.Client.Utils;
using System;
using System.Drawing;
using System.Xml;
public class XImFormStyle : StyleBase
{
private Bitmap _back_bottomfadeImage;
private Bitmap _back_topfadeImage;
private Color _backColor;
private Bitmap _bottom_leftfadeImage;
private Bitmap _bottom_leftfadeImage2;
private Bitmap _bottom_rightfadeImage;
private Bitmap _bottom_rightfadeImage2;
private Bitmap _bottomBorderImage;
private Bitmap _bottomBorderImage2;
private Bitmap _bottomleftImage;
private Bitmap _bottomleftImage2;
private Bitmap _bottomrightImage;
private Bitmap _bottomrightImage2;
private int _captionY;
private Bitmap _closeButtonImage;
private int _closeX;
private int _closeY;
private Bitmap _controlBox_Image;
private int _controlBoxX;
private int _controlBoxY;
private Bitmap _hemline_barImage;
private int _iconX;
private int _iconY;
private static XImFormStyle _instance;
private Bitmap _left_bottomfadeImage;
private Bitmap _left_HemlineImage;
private Bitmap _left_topfadeImage;
private Bitmap _leftBorderImage;
private Bitmap _maxButtonImage;
private int _maxX;
private int _maxY;
private Bitmap _minButtonImage;
private int _minX;
private int _minY;
private Bitmap _resizer_img;
private Bitmap _restoreButtonImage;
private Bitmap _right_bottomfadeImage;
private Bitmap _right_HemlineImage;
private Bitmap _right_topfadeImage;
private Bitmap _rightBorderImage;
private Bitmap _title_leftImage;
private Bitmap _title_leftImage_2;
private Bitmap _title_leftImage_2_Deactive;
private Bitmap _title_leftImage_Deactive;
private Bitmap _title_rightImage;
private Bitmap _title_rightImage_2;
private Bitmap _title_rightImage_2_Deactive;
private Bitmap _title_rightImage_Deactive;
private Bitmap _titlebar_Image;
private Bitmap _titlebar_Image_2;
private Bitmap _titlebar_Image_2_Deactive;
private Bitmap _titlebar_Image_Deactive;
private Bitmap _top_leftfadeImage;
private Bitmap _top_rightfadeImage;
private Bitmap _topBorderImage;
private Bitmap _topleftImage;
private Bitmap _toprightImage;
private Color _transParentColor;
public XImFormStyle()
{
_instance = this;
}
public override void ChangeColor(int hue, double sat, double lum)
{
HSLFilter.ChangeImageColor(ref this._leftBorderImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._rightBorderImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._topBorderImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomBorderImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._topleftImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._toprightImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomleftImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomrightImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._left_topfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._left_bottomfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._right_topfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._right_bottomfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._top_leftfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._top_rightfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottom_leftfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottom_rightfadeImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_leftImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._titlebar_Image, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_rightImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_leftImage_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._titlebar_Image_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_rightImage_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_leftImage_2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._titlebar_Image_2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_rightImage_2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_leftImage_2_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._titlebar_Image_2_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._title_rightImage_2_Deactive, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._resizer_img, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._minButtonImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._maxButtonImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._closeButtonImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._restoreButtonImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._hemline_barImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._left_HemlineImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._right_HemlineImage, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomleftImage2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomrightImage2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottomBorderImage2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottom_leftfadeImage2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._bottom_rightfadeImage2, hue, sat, lum, new RGB(this.TransParentColor));
HSLFilter.ChangeImageColor(ref this._controlBox_Image, hue, sat, lum, new RGB(this.TransParentColor));
base.ChangeColor(hue, sat, lum);
}
protected override void LoadStyle(XmlElement elem)
{
this.LeftBorderImage = base.GetImageAttribute(elem, "LeftBorderImage");
this.RightBorderImage = base.GetImageAttribute(elem, "RightBorderImage");
this.TopBorderImage = base.GetImageAttribute(elem, "TopBorderImage");
this.BottomBorderImage = base.GetImageAttribute(elem, "BottomBorderImage");
this.TopleftImage = base.GetImageAttribute(elem, "TopLeftImage");
this.ToprightImage = base.GetImageAttribute(elem, "TopRightImage");
this.BottomleftImage = base.GetImageAttribute(elem, "BottomLeftImage");
this.BottomrightImage = base.GetImageAttribute(elem, "BottomRightImage");
this.Left_topfadeImage = base.GetImageAttribute(elem, "Left_TopFadeImage");
this.Left_bottomfadeImage = base.GetImageAttribute(elem, "Left_BottomFadeImage");
this.Right_topfadeImage = base.GetImageAttribute(elem, "Right_TopFadeImage");
this.Right_bottomfadeImage = base.GetImageAttribute(elem, "Right_BottomFadeImage");
this.Top_leftfadeImage = base.GetImageAttribute(elem, "Top_LeftFadeImage");
this.Top_rightfadeImage = base.GetImageAttribute(elem, "Top_RightFadeImage");
this.Bottom_leftfadeImage = base.GetImageAttribute(elem, "Bottom_LeftFadeImage");
this.Bottom_rightfadeImage = base.GetImageAttribute(elem, "Bottom_RightFadeImage");
this.Title_leftImage = base.GetImageAttribute(elem, "Left_TitleImage");
this.Titlebar_Image = base.GetImageAttribute(elem, "TitleImage");
this.Title_rightImage = base.GetImageAttribute(elem, "Right_TitleImage");
this.Title_leftImage_Deactive = base.GetImageAttribute(elem, "Left_TitleImage_Deactive");
this.Titlebar_Image_Deactive = base.GetImageAttribute(elem, "TitleImage_Deactive");
this.Title_rightImage_Deactive = base.GetImageAttribute(elem, "Right_TitleImage_Deactive");
this.Title_leftImage_2 = base.GetImageAttribute(elem, "Left_TitleImage_2");
this.Titlebar_Image_2 = base.GetImageAttribute(elem, "TitleImage_2");
this.Title_rightImage_2 = base.GetImageAttribute(elem, "Right_TitleImage_2");
this.Title_leftImage_2_Deactive = base.GetImageAttribute(elem, "Left_TitleImage_2_Deactive");
this.Titlebar_Image_2_Deactive = base.GetImageAttribute(elem, "TitleImage_2_Deactive");
this.Title_rightImage_2_Deactive = base.GetImageAttribute(elem, "Right_TitleImage_2_Deactive");
this.Resizer_img = base.GetImageAttribute(elem, "Resizer_Image");
this.MinButtonImage = base.GetImageAttribute(elem, "Button_MinImage");
this.MaxButtonImage = base.GetImageAttribute(elem, "Button_MaxImage");
this.CloseButtonImage = base.GetImageAttribute(elem, "Button_CloseImage");
this.RestoreButtonImage = base.GetImageAttribute(elem, "Button_RestoreImage");
int red = base.GetIntegerAttribute(elem, "TransParentRedValue");
int green = base.GetIntegerAttribute(elem, "TransParentGreenValue");
int blue = base.GetIntegerAttribute(elem, "TransParentBlueValue");
this.TransParentColor = Color.FromArgb(red, green, blue);
if (elem.HasAttribute("BackColor"))
{
this.BackColor = ThemeManager.GetColor(elem.GetAttribute("BackColor"));
}
this.HemlineImage = base.GetImageAttribute(elem, "HemlineImage");
this.Left_HemlineImage = base.GetImageAttribute(elem, "Left_HemlineImage");
this.Right_HemlineImage = base.GetImageAttribute(elem, "Right_HemlineImage");
this.Back_TopFadeImage = base.GetImageAttribute(elem, "Back_TopFadeImage");
this.Back_BottomFadeImage = base.GetImageAttribute(elem, "Back_BottomFadeImage");
this.BottomleftImage2 = base.GetImageAttribute(elem, "BottomleftImage2");
this.BottomrightImage2 = base.GetImageAttribute(elem, "BottomRightImage2");
this.BottomBorderImage2 = base.GetImageAttribute(elem, "BottomBorderImage2");
this.Bottom_leftfadeImage2 = base.GetImageAttribute(elem, "Bottom_LeftFadeImage2");
this.Bottom_rightfadeImage2 = base.GetImageAttribute(elem, "Bottom_RightFadeImage2");
this.ControlBox_Image = base.GetImageAttribute(elem, "ControlBox_Image");
this.ControlBoxX = base.GetIntegerAttribute(elem, "ControlBoxX");
this.ControlBoxY = base.GetIntegerAttribute(elem, "ControlBoxY");
this.MinX = base.GetIntegerAttribute(elem, "MinX");
this.MinY = base.GetIntegerAttribute(elem, "MinY");
this.MaxX = base.GetIntegerAttribute(elem, "MaxX");
this.MaxY = base.GetIntegerAttribute(elem, "MaxY");
this.CloseX = base.GetIntegerAttribute(elem, "CloseX");
this.CloseY = base.GetIntegerAttribute(elem, "CloseY");
this.IconX = base.GetIntegerAttribute(elem, "IconX");
this.IconY = base.GetIntegerAttribute(elem, "IconY");
this.CaptionY = base.GetIntegerAttribute(elem, "CaptionY");
}
protected override void SetDefaultValue()
{
base.SetDefaultValue();
this._resizer_img = null;
}
internal Bitmap Back_BottomFadeImage
{
get
{
return this._back_bottomfadeImage;
}
set
{
if (this._back_bottomfadeImage != null)
{
this._back_bottomfadeImage.Dispose();
}
this._back_bottomfadeImage = value;
}
}
internal Bitmap Back_TopFadeImage
{
get
{
return this._back_topfadeImage;
}
set
{
if (this._back_topfadeImage != null)
{
this._back_topfadeImage.Dispose();
}
this._back_topfadeImage = value;
}
}
internal Color BackColor
{
get
{
return this._backColor;
}
set
{
this._backColor = value;
}
}
internal Bitmap Bottom_leftfadeImage
{
get
{
return this._bottom_leftfadeImage;
}
set
{
if (this._bottom_leftfadeImage != null)
{
this._bottom_leftfadeImage.Dispose();
}
this._bottom_leftfadeImage = value;
}
}
internal Bitmap Bottom_leftfadeImage2
{
get
{
return this._bottom_leftfadeImage2;
}
set
{
if (this._bottom_leftfadeImage2 != null)
{
this._bottom_leftfadeImage2.Dispose();
}
this._bottom_leftfadeImage2 = value;
}
}
internal Bitmap Bottom_rightfadeImage
{
get
{
return this._bottom_rightfadeImage;
}
set
{
if (this._bottom_rightfadeImage != null)
{
this._bottom_rightfadeImage.Dispose();
}
this._bottom_rightfadeImage = value;
}
}
internal Bitmap Bottom_rightfadeImage2
{
get
{
return this._bottom_rightfadeImage2;
}
set
{
if (this._bottom_rightfadeImage2 != null)
{
this._bottom_rightfadeImage2.Dispose();
}
this._bottom_rightfadeImage2 = value;
}
}
internal Bitmap BottomBorderImage
{
get
{
return this._bottomBorderImage;
}
set
{
if (this._bottomBorderImage != null)
{
this._bottomBorderImage.Dispose();
}
this._bottomBorderImage = value;
}
}
internal Bitmap BottomBorderImage2
{
get
{
return this._bottomBorderImage2;
}
set
{
if (this._bottomBorderImage2 != null)
{
this._bottomBorderImage2.Dispose();
}
this._bottomBorderImage2 = value;
}
}
internal Bitmap BottomleftImage
{
get
{
return this._bottomleftImage;
}
set
{
if (this._bottomleftImage != null)
{
this._bottomleftImage.Dispose();
}
this._bottomleftImage = value;
}
}
internal Bitmap BottomleftImage2
{
get
{
return this._bottomleftImage2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -