/// <summary> /// 渲染九宫格背景图 /// </summary> /// <param name="rect">渲染区域</param> public void RenderBackgroundImage9(Rectangle rect) { this.m_BackgroundImage9Rect = rect; if (this.m_State == State.Hidden || !RectangleEx.IsVisible(this.m_BackgroundImage9Rect) || this.CurrentBackgroundImage9 == null) { return; } if (this.m_State == State.Disabled && this.m_BackgroundImage9GrayOnDisabled)//灰色图片 { using (Image img = RenderEngine.GetGrayImage(this.CurrentBackgroundImage9)) { RenderEngine.DrawBackgroundImage9(this.m_Graphics, img, this.CurrentBackgroundImage9Rect, this.m_BackgroundImage9Padding.Left, this.m_BackgroundImage9Padding.Top, this.m_BackgroundImage9Padding.Right, this.m_BackgroundImage9Padding.Bottom, this.m_BackgroundImage9Layout); } } else//原图 { RenderEngine.DrawBackgroundImage9(this.m_Graphics, this.CurrentBackgroundImage9, this.CurrentBackgroundImage9Rect, this.m_BackgroundImage9Padding.Left, this.m_BackgroundImage9Padding.Top, this.m_BackgroundImage9Padding.Right, this.m_BackgroundImage9Padding.Bottom, this.m_BackgroundImage9Layout); } }