private void FillInBackground(Graphics g, Color backColor) { BasicBlockPainter.RenderFlatBackground( g, Bounds, backColor, BorderType, Radius, RoundedType); if (BorderType == ButtonBorderType.Ellipse && DrawLightGlass) { using (GraphicsPath gp = new GraphicsPath()) { Rectangle rect = Bounds; rect.Height--; rect.Width--; gp.AddEllipse(rect); using (PathGradientBrush pb = new PathGradientBrush(gp)) { pb.CenterPoint = new PointF(rect.X + rect.Width / 2.0f, rect.Y + rect.Height / 4.0f); pb.CenterColor = Color.FromArgb(180, Color.White); pb.SurroundColors = new Color[] { Color.FromArgb(40, Color.White) }; g.FillPath(pb, gp); } } } }
protected virtual void PaintThisBar(Graphics g) { BasicBlockPainter.RenderFlatBackground(g, ClientRectangle, GMBackColor, ButtonBorderType.Rectangle, BorderRadius, RoundStyle.All); if (DrawBackColorGlass) { BasicBlockPainter.RenderRectangleGlass(g, ClientRectangle, BorderRadius, RoundStyle.All, RectangleGlassPosition.Bottom, 270f, 0.5f, Color.White, 100, 20); } Rectangle rectCover = CoveredRect; if (rectCover.Width > 0) { rectCover.Inflate(1, 1); BasicBlockPainter.RenderFlatBackground(g, rectCover, CoveredColor, ButtonBorderType.Rectangle, BorderRadius, RoundStyle.All); if (DrawCoveredColorGlass) { BasicBlockPainter.RenderRectangleGlass(g, rectCover, BorderRadius, RoundStyle.All, RectangleGlassPosition.Top, 90.001f); } } if (DrawLeadingEdge && Percentage != 100) { rectCover.Inflate(-1, -1); Point p1 = new Point(rectCover.Right - 1 + 1, rectCover.Y); Point p2 = new Point(rectCover.Right - 1 + 1, rectCover.Bottom - 1); using (Pen p = new Pen(LeadingEdgeColor)) { g.DrawLine(p, p1, p2); } } if (ShowPercentageText) { TextRenderer.DrawText(g, text, ForeFont, ClientRectangle, ForeColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter); } Rectangle rectBorder = ClientRectangle; BasicBlockPainter.RenderBorder(g, rectBorder, BorderColor, ButtonBorderType.Rectangle, BorderRadius, RoundStyle.All); if (DrawInnerBorder) { rectBorder.Inflate(-1, -1); BasicBlockPainter.RenderBorder(g, rectBorder, InnerBorderColor, ButtonBorderType.Rectangle, BorderRadius, RoundStyle.All); } }