/// <summary> /// 渲染边框颜色(RoundStyle圆角样式,BorderStyle确定绘制哪个边,BlendStyle混合方式) /// </summary> /// <param name="rect">渲染区域</param> public void RenderBorder(Rectangle rect) { this.m_BorderColorRect = rect; if (this.m_State == State.Hidden || !RectangleEx.IsVisible(this.m_BorderColorRect)) { return; } //重置剪切区 this.m_Graphics.SetClip(this.m_GraphicsClip, CombineMode.Replace); //绘制内边框 if (this.m_InnerBorderVisibleStyle != BorderVisibleStyle.None) { using (Brush brush = RenderEngine.CreateBrush(this.CurrentInnerBorderBrushRect, this.CurrentInnerBorderColor, this.m_InnerBorderColorPos1, this.m_InnerBorderColorPos2, this.CurrentBackColorReverse, this.CurrentBackColorMode, this.m_InnerBorderBlendStyle)) { using (Pen pen = RenderEngine.CreatePen(brush, 1, this.m_InnerBorderDashStyle, this.m_InnerBorderDashPattern, this.m_InnerBorderDashCap, this.m_InnerBorderDashOffset)) { RenderEngine.DrawBorder(this.m_Graphics, pen, this.CurrentInnerBorderPathRect, this.m_InnerBorderVisibleStyle, this.m_RoundCornerStyle, this.m_RoundStyle, this.m_RoundRadius, false); } } } //绘制边框 if (this.m_BorderVisibleStyle != BorderVisibleStyle.None) { using (Brush brush = RenderEngine.CreateBrush(this.CurrentBorderBrushRect, this.CurrentBorderColor, this.m_BorderColorPos1, this.m_BorderColorPos2, this.CurrentBackColorReverse, this.CurrentBackColorMode, this.m_BorderBlendStyle)) { using (Pen pen = RenderEngine.CreatePen(brush, 1, this.m_BorderDashStyle, this.m_BorderDashPattern, this.m_BorderDashCap, this.m_BorderDashOffset)) { RenderEngine.DrawBorder(this.m_Graphics, pen, this.CurrentBorderPathRect, this.m_BorderVisibleStyle, this.m_RoundCornerStyle, this.m_RoundStyle, this.m_RoundRadius, false); } } } }