📄 crystal_band_tools.cs
字号:
namespace Imps.Client.Pc.BizControls
{
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
public static class crystal_band_tools
{
public static void draw_crystal_band(Graphics g, Rectangle rect, crystal_band_colors colors, bool fVertical)
{
Pen pen;
if ((rect.Top >= rect.Bottom) || (rect.Left >= rect.Right))
{
return;
}
if (fVertical)
{
Rectangle rectangle = Rectangle.FromLTRB(rect.Left, rect.Top, rect.Left + (rect.Width / 3), rect.Bottom);
if ((rectangle.Left < rectangle.Right) && (rectangle.Top < rectangle.Bottom))
{
using (LinearGradientBrush brush = new LinearGradientBrush(rectangle, colors.toppart_up_color, colors.toppart_down_color, LinearGradientMode.Horizontal))
{
g.FillRectangle(brush, rectangle);
}
}
rectangle = Rectangle.FromLTRB(rectangle.Right, rectangle.Top, rect.Right, rect.Bottom);
if ((rectangle.Left < rectangle.Right) && (rectangle.Top < rectangle.Bottom))
{
using (LinearGradientBrush brush2 = new LinearGradientBrush(rectangle, colors.bottompart_up_color, colors.bottompart_down_color, LinearGradientMode.Horizontal))
{
g.FillRectangle(brush2, rectangle);
}
}
using (Pen pen = new Pen(colors.toppart_down_color))
{
g.DrawLine(pen, rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Bottom);
goto Label_026E;
}
}
Rectangle rectangle2 = Rectangle.FromLTRB(rect.Left, rect.Top, rect.Right, rect.Top + (rect.Height / 3));
if ((rectangle2.Left < rectangle2.Right) && (rectangle2.Top < rectangle2.Bottom))
{
using (LinearGradientBrush brush3 = new LinearGradientBrush(rectangle2, colors.toppart_up_color, colors.toppart_down_color, LinearGradientMode.Vertical))
{
g.FillRectangle(brush3, rectangle2);
}
}
rectangle2 = Rectangle.FromLTRB(rect.Left, rectangle2.Bottom, rect.Right, rect.Bottom);
if ((rectangle2.Left < rectangle2.Right) && (rectangle2.Top < rectangle2.Bottom))
{
using (LinearGradientBrush brush4 = new LinearGradientBrush(rectangle2, colors.bottompart_up_color, colors.bottompart_down_color, LinearGradientMode.Vertical))
{
g.FillRectangle(brush4, rectangle2);
}
}
using (Pen pen2 = new Pen(colors.toppart_down_color))
{
g.DrawLine(pen2, rectangle2.Left, rectangle2.Top, rectangle2.Right, rectangle2.Top);
}
Label_026E:
pen = new Pen(colors.border_color);
try
{
g.DrawLine(pen, rect.Left, rect.Top, rect.Right, rect.Top);
g.DrawLine(pen, rect.Right, rect.Top, rect.Right, rect.Bottom);
g.DrawLine(pen, rect.Right, rect.Bottom, rect.Left, rect.Bottom);
g.DrawLine(pen, rect.Left, rect.Bottom, rect.Left, rect.Top);
}
finally
{
if (pen != null)
{
pen.Dispose();
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -