private void DrawHeaderPanel(Graphics gfx, Rectangle rc, Color clrStart, Color clrEnd) { rc.Inflate(-1, -1); using (GraphicsPath pathMenuPanel = VistaMenuControl.RoundRect((RectangleF)rc, 7, 7, 7, 7)) { using (LinearGradientBrush lgb = new LinearGradientBrush(rc, clrStart, clrEnd, 90f)) { gfx.SmoothingMode = SmoothingMode.HighQuality; gfx.CompositingQuality = CompositingQuality.HighQuality; gfx.FillPath(lgb, pathMenuPanel); if (CurrentItemState == eSettingItem_State.Selected || CurrentItemState == eSettingItem_State.Hover) { Rectangle rcItem = rc; rcItem.X = 5; rcItem.Y = 4; rcItem.Width = rc.Width - 2; rcItem.Height = this.pnlHeader.Height; Rectangle rcUpRect = rcItem; Rectangle rcDownRect = rcItem; rcUpRect.Height /= 2; rcDownRect.Height /= 2; rcDownRect.Y = rcUpRect.Height + 3; VistaMenuControl.FillMenuItem(gfx, rcUpRect, rcDownRect, _clrSelectionStartColor, _clrSelectionEndColor, _clrSelectionStartColorStart, _clrSelectionEndColorEnd, 7); } } } }
public static void DrawGradientBckground(Graphics gfx, Rectangle rc, Color clrStart, Color clrEnd) { rc.Inflate(-1, -1); using (GraphicsPath pathMenuPanel = VistaMenuControl.RoundRect((RectangleF)rc, 7, 7, 7, 7)) { using (LinearGradientBrush lgb = new LinearGradientBrush( rc, clrStart, clrEnd, 90f)) { gfx.SmoothingMode = SmoothingMode.HighQuality; gfx.CompositingQuality = CompositingQuality.HighQuality; gfx.FillPath(lgb, pathMenuPanel); } } }