基线 SVN r240

SVN-Revision: r240
This commit is contained in:
cyf
2025-02-06 06:46:06 +00:00
commit ab56a9bcf7
5317 changed files with 902274 additions and 0 deletions
@@ -0,0 +1,37 @@
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace Lskj.Control.ImageLibrary
{
/// <summary>
/// 绘制虚线边框
/// </summary>
[Description("绘制虚线边框")]
public class DottedLineBorderExtDesigner : ControlDesigner
{
protected override void OnPaintAdornments(PaintEventArgs pe)
{
base.OnPaintAdornments(pe);
this.DrawBorder(pe.Graphics);
}
/// <summary>
/// 绘制虚线边框
/// </summary>
/// <param name="graphics"></param>
private void DrawBorder(Graphics graphics)
{
System.Windows.Forms.Control control = this.Control;
Rectangle clientRectangle = control.ClientRectangle;
Pen pen = new Pen((double)control.BackColor.GetBrightness() >= 0.5 ? ControlPaint.Dark(control.BackColor) : ControlPaint.Light(control.BackColor));
pen.DashStyle = DashStyle.Dash;
--clientRectangle.Width;
--clientRectangle.Height;
graphics.DrawRectangle(pen, clientRectangle);
pen.Dispose();
}
}
}