/// <summary> /// 渲染背景图 /// </summary> /// <param name="rect">渲染区域</param> public void RenderBackgroundImage(Rectangle rect) { this.m_BackgroundImageRect = rect; if (this.m_State == State.Hidden || !RectangleEx.IsVisible(this.m_BackgroundImageRect) || this.CurrentBackgroundImage == null) { return; } if (this.m_State == State.Disabled && this.m_BackgroundImageGrayOnDisabled)//灰色图片 { using (Image img = RenderEngine.GetGrayImage(this.CurrentBackgroundImage)) { RenderEngine.DrawBackgroundImage(this.m_Graphics, img, this.CurrentBackgroundImageRect, this.m_BackgroundImageLayout); } } else//原图 { RenderEngine.DrawBackgroundImage(this.m_Graphics, this.CurrentBackgroundImage, this.CurrentBackgroundImageRect, this.m_BackgroundImageLayout); } }