protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); base.OnPaint(e); Size = Size; _Style = Style; G.Clear(BackColor); G.SmoothingMode = SmoothingMode.HighQuality; switch (_Style) { case LineStyle.Horizontal: G.DrawLine(Draw.GetPen(Color.Black), 0, 0, Width - 1, Height - 3); G.DrawLine(Draw.GetPen(Color.FromArgb(99, 97, 94)), 0, 1, Width - 1, Height - 2); break; case LineStyle.Vertical: G.DrawLine(Draw.GetPen(Color.Black), 0, 0, 0, Height - 1); G.DrawLine(Draw.GetPen(Color.FromArgb(99, 97, 94)), 1, 0, 1, Height - 1); break; } e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); Font FF = new Font("Arial", 9, FontStyle.Bold); try { SelectedTab.BackColor = Color.FromArgb(56, 52, 49); } catch { } G.Clear(Parent.FindForm().BackColor); G.FillRectangle(TabBGTexture, new Rectangle(0, 0, ItemSize.Height + 3, Height - 1)); //Full Tab Background G.DrawLine(Draw.GetPen(Color.FromArgb(44, 42, 39)), 1, Height - 3, ItemSize.Height + 3, Height - 3); G.DrawLine(Draw.GetPen(Color.FromArgb(48, 45, 43)), 1, Height - 4, ItemSize.Height + 3, Height - 4); G.DrawLine(Draw.GetPen(Color.FromArgb(53, 50, 47)), 1, Height - 5, ItemSize.Height + 3, Height - 5); for (int i = 0; i <= TabCount - 1; i++) { int y = GetTabRect(i).Height * 2; while (!(y >= Height - 1)) { G.DrawLine(Pens.Black, 1, y, Width - 2, y); G.DrawLine(Draw.GetPen(Color.FromArgb(99, 97, 94)), 1, y + 1, Width - 2, y + 1); y = y + GetTabRect(0).Height; } if (i == SelectedIndex) { Rectangle x2 = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); if (SelectedIndex == 0) { Rectangle tabRect = new Rectangle(GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 1, GetTabRect(i).Size.Width - 1, GetTabRect(i).Size.Height - 1); LinearGradientBrush TabOverlay = new LinearGradientBrush(tabRect, Color.FromArgb(114, 203, 232), Color.FromArgb(58, 118, 188), 90); G.FillRectangle(TabOverlay, tabRect); G.DrawLine(Draw.GetPen(Color.FromArgb(235, 255, 255)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 1, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y - 1); } else { Rectangle tabRect = new Rectangle(GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 2, GetTabRect(i).Size.Width - 1, GetTabRect(i).Size.Height); LinearGradientBrush TabOverlay = new LinearGradientBrush(tabRect, Color.FromArgb(114, 203, 232), Color.FromArgb(58, 118, 188), 90); G.FillRectangle(TabOverlay, tabRect); G.DrawLine(Draw.GetPen(Color.FromArgb(235, 255, 255)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 2, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y - 2); } G.DrawLine(Pens.Black, GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 33, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 33); G.SmoothingMode = SmoothingMode.HighQuality; G.DrawString(TabPages[i].Text, FF, Draw.GetBrush(Color.FromArgb(20, 20, 20)), new Rectangle(x2.X, x2.Y - 1, x2.Width + 1, x2.Height + 2), new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }); G.DrawString(TabPages[i].Text, FF, Brushes.White, new Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }); G.DrawLine(new Pen(Color.FromArgb(96, 110, 121)), new Point(x2.Location.X - 1, x2.Location.Y - 1), new Point(x2.Location.X, x2.Location.Y)); G.DrawLine(new Pen(Color.FromArgb(96, 110, 121)), new Point(x2.Location.X - 1, x2.Bottom - 1), new Point(x2.Location.X, x2.Bottom)); } else { Rectangle x2 = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); Rectangle tabRect = new Rectangle(GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 2, GetTabRect(i).Size.Width - 1, GetTabRect(i).Size.Height - 1); G.FillRectangle(InnerTexture, tabRect); //Highlight Fill Background LinearGradientBrush TabOverlay = new LinearGradientBrush(tabRect, Color.FromArgb(15, Color.White), Color.FromArgb(100, Color.FromArgb(43, 40, 38)), 90); G.FillRectangle(TabOverlay, tabRect); G.DrawLine(Draw.GetPen(Color.FromArgb(113, 110, 108)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y - 1, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y - 1); G.DrawLine(Pens.Black, GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 32, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 32); if (i == TabCount - 1) { G.DrawLine(Draw.GetPen(Color.FromArgb(64, 60, 57)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 31, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 31); G.DrawLine(Draw.GetPen(Color.FromArgb(35, 33, 31)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 33, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 33); G.DrawLine(Draw.GetPen(Color.FromArgb(43, 41, 38)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 34, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 34); G.DrawLine(Draw.GetPen(Color.FromArgb(53, 50, 47)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 35, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 35); G.DrawLine(Draw.GetPen(Color.FromArgb(58, 55, 51)), GetTabRect(i).Location.X, GetTabRect(i).Location.Y + 36, GetTabRect(i).Size.Width, GetTabRect(i).Location.Y + 36); } G.DrawString(TabPages[i].Text, FF, new SolidBrush(Color.FromArgb(210, 220, 230)), new Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }); } G.FillRectangle(new SolidBrush(Color.FromArgb(56, 52, 49)), new Rectangle(123, -1, Width - 123, Height + 1)); //Page Fill Full G.DrawRectangle(Pens.Black, new Rectangle(123, 0, Width - 124, Height - 2)); Color[] c = { Color.FromArgb(43, 40, 38), Color.FromArgb(50, 47, 44), Color.FromArgb(55, 52, 49) }; Draw.InnerGlow(G, new Rectangle(124, 1, Width - 125, Height - 3), c); } G.DrawLine(Draw.GetPen(Color.FromArgb(56, 52, 49)), -1, Height - 1, ItemSize.Height + 1, Height - 1); G.DrawLine(Draw.GetPen(Color.FromArgb(56, 52, 49)), 0, -1, 0, Height - 1); G.DrawRectangle(new Pen(new SolidBrush(Color.Black)), new Rectangle(1, 0, ItemSize.Height, Height - 2)); //Full Tab Inner Outline e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); Rectangle ClientRectangle = new Rectangle(3, 3, Width - 7, Height - 7); base.OnPaint(e); G.Clear(BackColor); G.SmoothingMode = SmoothingMode.HighQuality; switch (_Shade) { case InnerShade.Dark: G.FillPath(InnerTexture, Draw.CreateRound(ClientRectangle, 3)); G.DrawPath(Draw.GetPen(Color.FromArgb(40, 38, 36)), Draw.CreateRound(new Rectangle(3, 3, Width - 6, Height - 6), 3)); G.DrawPath(Draw.GetPen(Color.FromArgb(45, 43, 41)), Draw.CreateRound(new Rectangle(3, 3, Width - 6, Height - 5), 3)); G.DrawPath(Draw.GetPen(Color.FromArgb(50, 48, 46)), Draw.CreateRound(new Rectangle(2, 2, Width - 5, Height - 3), 3)); LinearGradientBrush HighlightGradient = new LinearGradientBrush(new Rectangle(4, 4, Width - 8, Height - 8), Color.FromArgb(160, 158, 157), Color.FromArgb(61, 57, 54), 90); Pen hp = new Pen(HighlightGradient); G.DrawPath(hp, Draw.CreateRound(new Rectangle(4, 4, Width - 9, Height - 9), 3)); LinearGradientBrush OutlineGradient = new LinearGradientBrush(new Rectangle(3, 3, Width - 7, Height - 6), Color.FromArgb(34, 32, 30), Color.Black, 90); Pen op = new Pen(OutlineGradient); G.DrawPath(op, Draw.CreateRound(new Rectangle(3, 3, Width - 7, Height - 7), 3)); Font drawFont = new Font("Arial", 9, FontStyle.Bold); switch (State) { case MouseState.None: G.DrawString(Text, drawFont, Brushes.White, new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; case MouseState.Over: G.DrawString(Text, drawFont, Brushes.White, new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; case MouseState.Down: G.DrawString(Text, drawFont, Brushes.White, new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; } break; case InnerShade.Light: LinearGradientBrush MainGradient = new LinearGradientBrush(ClientRectangle, Color.FromArgb(225, 227, 230), Color.FromArgb(199, 201, 204), 90); G.FillPath(MainGradient, Draw.CreateRound(ClientRectangle, 3)); G.DrawPath(Draw.GetPen(Color.FromArgb(167, 168, 171)), Draw.CreateRound(new Rectangle(3, 3, Width - 6, Height - 6), 3)); G.DrawPath(Draw.GetPen(Color.FromArgb(203, 205, 208)), Draw.CreateRound(new Rectangle(2, 2, Width - 5, Height - 4), 3)); LinearGradientBrush HighlightGradient1 = new LinearGradientBrush(new Rectangle(4, 4, Width - 8, Height - 8), Color.FromArgb(255, 255, 255), Color.FromArgb(218, 219, 222), 90); Pen hp1 = new Pen(HighlightGradient1); G.DrawPath(hp1, Draw.CreateRound(new Rectangle(4, 4, Width - 9, Height - 9), 3)); LinearGradientBrush OutlineGradient1 = new LinearGradientBrush(new Rectangle(3, 3, Width - 7, Height - 6), Color.FromArgb(173, 174, 177), Color.FromArgb(110, 111, 114), 90); Pen op1 = new Pen(OutlineGradient1); G.DrawPath(op1, Draw.CreateRound(new Rectangle(3, 3, Width - 7, Height - 7), 3)); Font drawFont1 = new Font("Arial", 9, FontStyle.Bold); switch (State) { case MouseState.None: G.DrawString(Text, drawFont1, Draw.GetBrush(Color.FromArgb(109, 109, 110)), new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; case MouseState.Over: G.DrawString(Text, drawFont1, Draw.GetBrush(Color.FromArgb(109, 109, 110)), new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; case MouseState.Down: G.DrawString(Text, drawFont1, Draw.GetBrush(Color.FromArgb(109, 109, 110)), new Rectangle(0, 0, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); break; } break; } e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); //G.SmoothingMode = SmoothingMode.HighQuality int intValue = Convert.ToInt32(_Value / _Maximum * Width); G.Clear(BackColor); SolidBrush percentColor = new SolidBrush(Color.White); G.FillRectangle(InnerTexture, new Rectangle(0, 0, Width - 1, Height - 1)); ColorBlend blend = new ColorBlend(); //Add the Array of Color Color[] bColors = new Color[] { Color.FromArgb(20, Color.White), Color.FromArgb(10, Color.Black), Color.FromArgb(10, Color.White) }; blend.Colors = bColors; //Add the Array Single (0-1) colorpoints to place each Color float[] bPts = new float[] { 0, 0.8f, 1 }; blend.Positions = bPts; using (LinearGradientBrush br = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.White, Color.Black, LinearGradientMode.Vertical)) { //Blend the colors into the Brush br.InterpolationColors = blend; //Fill the rect with the blend G.FillRectangle(br, new Rectangle(0, 0, Width - 1, Height - 1)); } G.DrawRectangle(Pens.Black, new Rectangle(0, 0, Width - 1, Height - 1)); G.DrawLine(Draw.GetPen(Color.FromArgb(99, 97, 94)), 1, 1, Width - 3, 1); G.DrawLine(Draw.GetPen(Color.FromArgb(64, 60, 57)), 1, Height - 2, Width - 3, Height - 2); ////// Bar Fill if (!(intValue == 0)) { G.FillRectangle(new LinearGradientBrush(new Rectangle(2, 2, intValue - 3, Height - 4), Color.FromArgb(114, 203, 232), Color.FromArgb(58, 118, 188), 90), new Rectangle(2, 2, intValue - 3, Height - 4)); G.DrawLine(Draw.GetPen(Color.FromArgb(235, 255, 255)), 2, 2, intValue - 2, 2); //G.DrawLine(GetPen(Color.FromArgb(27, 25, 23)), 2, Height - 2, intValue + 1, Height - 2) percentColor = new SolidBrush(Color.White); } if (_ShowPercentage) { G.DrawString(Convert.ToString(string.Concat(Value, "%")), new Font("Arial", 10, FontStyle.Bold), Draw.GetBrush(Color.FromArgb(20, 20, 20)), new Rectangle(1, 2, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); G.DrawString(Convert.ToString(string.Concat(Value, "%")), new Font("Arial", 10, FontStyle.Bold), percentColor, new Rectangle(0, 1, Width - 1, Height - 1), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); } e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Graphics G = e.Graphics; base.OnPaint(e); G.Clear(Color.Fuchsia); Rectangle mainRect = new Rectangle(0, 0, Width, Height); LinearGradientBrush LeftHighlight = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(66, 64, 63), Color.FromArgb(56, 54, 53), 90); LinearGradientBrush RightHighlight = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(80, 78, 77), Color.FromArgb(70, 68, 67), 90); LinearGradientBrush TopOverlay = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, 53), Color.FromArgb(15, Color.White), Color.FromArgb(100, Color.FromArgb(43, 40, 38)), 90); LinearGradientBrush mainGradient = new LinearGradientBrush(mainRect, Color.FromArgb(73, 71, 69), Color.FromArgb(69, 67, 64), 90); G.FillRectangle(mainGradient, mainRect); //Outside Rectangle G.DrawRectangle(Pens.Black, new Rectangle(0, 0, Width - 1, Height - 1)); G.FillRectangle(InnerTexture, new Rectangle(10, 53, Width - 21, Height - 84)); //Inner Rectangle G.DrawRectangle(Pens.Black, new Rectangle(10, 53, Width - 21, Height - 84)); G.FillRectangle(TopTexture, new Rectangle(0, 0, Width - 1, 53)); //Top Bar Rectangle G.FillRectangle(TopOverlay, new Rectangle(0, 0, Width - 1, 53)); G.DrawRectangle(Pens.Black, new Rectangle(0, 0, Width - 1, 53)); ColorBlend blend = new ColorBlend(); //Add the Array of Color Color[] bColors = new Color[] { Color.FromArgb(10, Color.White), Color.FromArgb(10, Color.Black), Color.FromArgb(10, Color.White) }; blend.Colors = bColors; //Add the Array Single (0-1) colorpoints to place each Color float[] bPts = new float[] { 0, 0.7f, 1 }; blend.Positions = bPts; Rectangle rect = new Rectangle(0, 0, Width - 1, 53); using (LinearGradientBrush br = new LinearGradientBrush(rect, Color.White, Color.Black, LinearGradientMode.Vertical)) { //Blend the colors into the Brush br.InterpolationColors = blend; //Fill the rect with the blend G.FillRectangle(br, rect); } G.DrawLine(Draw.GetPen(Color.FromArgb(173, 172, 172)), 4, 1, Width - 5, 1); //Top Middle Highlight G.DrawLine(Draw.GetPen(Color.FromArgb(110, 109, 107)), 11, Height - 30, Width - 12, Height - 30); //Bottom Middle Highlight G.FillRectangle(Draw.GetBrush(Color.FromArgb(173, 172, 172)), 3, 2, 1, 1); //Top Left Corner Highlight G.FillRectangle(Draw.GetBrush(Color.FromArgb(133, 132, 132)), 2, 2, 1, 1); G.FillRectangle(Draw.GetBrush(Color.FromArgb(113, 112, 112)), 2, 3, 1, 1); G.FillRectangle(Draw.GetBrush(Color.FromArgb(83, 82, 82)), 1, 4, 1, 1); G.FillRectangle(Draw.GetBrush(Color.FromArgb(173, 172, 172)), Width - 4, 2, 1, 1); //Top Right Corner Highlight G.FillRectangle(Draw.GetBrush(Color.FromArgb(133, 132, 132)), Width - 3, 2, 1, 1); G.FillRectangle(Draw.GetBrush(Color.FromArgb(113, 112, 112)), Width - 3, 3, 1, 1); G.FillRectangle(Draw.GetBrush(Color.FromArgb(83, 82, 82)), Width - 2, 4, 1, 1); //// Shadows G.DrawLine(Draw.GetPen(Color.FromArgb(91, 90, 89)), 1, 52, Width - 2, 52); //Middle Top Horizontal G.DrawLine(Draw.GetPen(Color.FromArgb(40, 37, 34)), 11, 54, Width - 12, 54); G.DrawLine(Draw.GetPen(Color.FromArgb(45, 42, 39)), 11, 55, Width - 12, 55); G.DrawLine(Draw.GetPen(Color.FromArgb(50, 47, 44)), 11, 56, Width - 12, 56); G.DrawLine(Draw.GetPen(Color.FromArgb(50, 47, 44)), 11, Height - 32, Width - 12, Height - 32); //Middle Bottom Horizontal G.DrawLine(Draw.GetPen(Color.FromArgb(52, 49, 46)), 11, Height - 33, Width - 12, Height - 33); G.DrawLine(Draw.GetPen(Color.FromArgb(54, 51, 48)), 11, Height - 34, Width - 12, Height - 34); G.DrawLine(Draw.GetPen(Color.FromArgb(59, 57, 55)), 1, 54, 9, 54); //Left Horizontal G.DrawLine(Draw.GetPen(Color.FromArgb(64, 62, 60)), 1, 55, 9, 55); G.DrawLine(Draw.GetPen(Color.FromArgb(73, 71, 69)), 1, 56, 9, 56); G.DrawLine(Draw.GetPen(Color.FromArgb(59, 57, 55)), Width - 10, 54, Width - 2, 54); //Right Horizontal G.DrawLine(Draw.GetPen(Color.FromArgb(64, 62, 60)), Width - 10, 55, Width - 2, 55); G.DrawLine(Draw.GetPen(Color.FromArgb(73, 71, 69)), Width - 10, 56, Width - 2, 56); G.DrawLine(Draw.GetPen(Color.FromArgb(59, 57, 55)), 1, 54, 1, Height - 5); //Left Vertical G.DrawLine(Draw.GetPen(Color.FromArgb(64, 62, 60)), 2, 55, 2, Height - 4); G.DrawLine(Draw.GetPen(Color.FromArgb(73, 71, 69)), 3, 56, 3, Height - 3); G.DrawLine(new Pen(LeftHighlight), 1, 5, 1, 51); G.DrawLine(new Pen(RightHighlight), 2, 5, 2, 51); G.DrawLine(Draw.GetPen(Color.FromArgb(69, 67, 65)), 9, 56, 9, Height - 31); G.DrawLine(Draw.GetPen(Color.FromArgb(59, 57, 55)), Width - 2, 54, Width - 2, Height - 5); //Right Vertical G.DrawLine(Draw.GetPen(Color.FromArgb(64, 62, 60)), Width - 3, 55, Width - 3, Height - 4); G.DrawLine(Draw.GetPen(Color.FromArgb(73, 71, 69)), Width - 4, 56, Width - 4, Height - 3); G.DrawLine(new Pen(LeftHighlight), Width - 2, 5, Width - 2, 51); G.DrawLine(new Pen(RightHighlight), Width - 3, 5, Width - 3, 51); G.DrawLine(Draw.GetPen(Color.FromArgb(69, 67, 65)), Width - 10, 56, Width - 10, Height - 31); G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(255, 255, 255)), new Rectangle(0, 0, Width, 37), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); //////left upper corner G.FillRectangle(Brushes.Fuchsia, 0, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, 1, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, 2, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, 3, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, 2, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, 3, 1, 1); G.FillRectangle(Brushes.Fuchsia, 1, 1, 1, 1); G.FillRectangle(Brushes.Black, 1, 3, 1, 1); G.FillRectangle(Brushes.Black, 1, 2, 1, 1); G.FillRectangle(Brushes.Black, 2, 1, 1, 1); G.FillRectangle(Brushes.Black, 3, 1, 1, 1); //'////right upper corner G.FillRectangle(Brushes.Fuchsia, Width - 1, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 2, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 3, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 4, 0, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, 2, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, 3, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 2, 1, 1, 1); G.FillRectangle(Brushes.Black, Width - 2, 3, 1, 1); G.FillRectangle(Brushes.Black, Width - 2, 2, 1, 1); G.FillRectangle(Brushes.Black, Width - 3, 1, 1, 1); G.FillRectangle(Brushes.Black, Width - 4, 1, 1, 1); //'////left bottom corner G.FillRectangle(Brushes.Fuchsia, 0, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, Height - 2, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, Height - 3, 1, 1); G.FillRectangle(Brushes.Fuchsia, 0, Height - 4, 1, 1); G.FillRectangle(Brushes.Fuchsia, 1, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 2, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 3, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 1, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, 1, Height - 2, 1, 1); G.FillRectangle(Brushes.Black, 1, Height - 3, 1, 1); G.FillRectangle(Brushes.Black, 1, Height - 4, 1, 1); G.FillRectangle(Brushes.Black, 3, Height - 2, 1, 1); G.FillRectangle(Brushes.Black, 2, Height - 2, 1, 1); //'////right bottom corner G.FillRectangle(Brushes.Fuchsia, Width - 1, Height, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 2, Height, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 3, Height, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 4, Height, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, Height - 2, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, Height - 3, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 2, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 3, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 4, Height - 1, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 1, Height - 4, 1, 1); G.FillRectangle(Brushes.Fuchsia, Width - 2, Height - 2, 1, 1); G.FillRectangle(Brushes.Black, Width - 2, Height - 3, 1, 1); G.FillRectangle(Brushes.Black, Width - 2, Height - 4, 1, 1); G.FillRectangle(Brushes.Black, Width - 4, Height - 2, 1, 1); G.FillRectangle(Brushes.Black, Width - 3, Height - 2, 1, 1); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); Rectangle ClientRectangle = new Rectangle(0, 0, Width - 1, Height - 1); Rectangle BarRect = new Rectangle(0, 0, Width - 1, 32); base.OnPaint(e); G.Clear(BackColor); G.SmoothingMode = SmoothingMode.HighQuality; switch (_Shade) { case InnerShade.Light: LinearGradientBrush mainGradient = new LinearGradientBrush(ClientRectangle, Color.FromArgb(228, 230, 232), Color.FromArgb(199, 201, 205), 90); G.FillRectangle(mainGradient, ClientRectangle); G.DrawRectangle(Pens.Black, ClientRectangle); break; case InnerShade.Dark: G.FillRectangle(InnerTexture, ClientRectangle); G.DrawRectangle(Pens.Black, ClientRectangle); break; } LinearGradientBrush TopOverlay = new LinearGradientBrush(ClientRectangle, Color.FromArgb(5, Color.White), Color.FromArgb(10, Color.White), 90); G.FillRectangle(TopTexture, BarRect); ColorBlend blend = new ColorBlend(); //Add the Array of Color Color[] bColors = new Color[] { Color.FromArgb(20, Color.White), Color.FromArgb(10, Color.Black), Color.FromArgb(10, Color.White) }; blend.Colors = bColors; //Add the Array Single (0-1) colorpoints to place each Color float[] bPts = new float[] { 0, 0.9f, 1 }; blend.Positions = bPts; using (LinearGradientBrush br = new LinearGradientBrush(BarRect, Color.White, Color.Black, LinearGradientMode.Vertical)) { //Blend the colors into the Brush br.InterpolationColors = blend; //Fill the rect with the blend G.FillRectangle(br, BarRect); } G.DrawRectangle(Pens.Black, BarRect); //// Top Bar Highlights G.DrawLine(Draw.GetPen(Color.FromArgb(112, 109, 107)), 1, 1, Width - 2, 1); G.DrawLine(Draw.GetPen(Color.FromArgb(67, 63, 60)), 1, BarRect.Height - 1, Width - 2, BarRect.Height - 1); switch (_Shade) { case InnerShade.Light: Color[] c = { Color.FromArgb(153, 153, 153), Color.FromArgb(173, 174, 177), Color.FromArgb(200, 201, 204) }; Draw.InnerGlow(G, new Rectangle(1, 33, Width - 2, Height - 34), c); break; case InnerShade.Dark: Color[] c1 = { Color.FromArgb(43, 40, 38), Color.FromArgb(50, 47, 44), Color.FromArgb(55, 52, 49) }; Draw.InnerGlow(G, new Rectangle(1, 33, Width - 2, Height - 34), c1); break; } Font drawFont = new Font("Arial", 9, FontStyle.Bold); G.DrawString(Text, drawFont, Brushes.White, new Rectangle(15, 3, Width - 1, 26), new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }); e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); Rectangle BarRect = new Rectangle(0, 0, Width - 1, Height - 1); base.OnPaint(e); G.Clear(BackColor); G.SmoothingMode = SmoothingMode.HighQuality; LinearGradientBrush TopOverlay = new LinearGradientBrush(BarRect, Color.FromArgb(5, Color.White), Color.FromArgb(10, Color.White), 90); G.FillRectangle(TopTexture, BarRect); ColorBlend blend = new ColorBlend(); //Add the Array of Color Color[] bColors = new Color[] { Color.FromArgb(20, Color.White), Color.FromArgb(10, Color.Black), Color.FromArgb(10, Color.White) }; blend.Colors = bColors; //Add the Array Single (0-1) colorpoints to place each Color float[] bPts = new float[] { 0, 0.9f, 1 }; blend.Positions = bPts; using (LinearGradientBrush br = new LinearGradientBrush(BarRect, Color.White, Color.Black, LinearGradientMode.Vertical)) { //Blend the colors into the Brush br.InterpolationColors = blend; //Fill the rect with the blend G.FillRectangle(br, BarRect); } G.DrawRectangle(Pens.Black, BarRect); //// Top Bar Highlights G.DrawLine(Draw.GetPen(Color.FromArgb(112, 109, 107)), 1, 1, Width - 2, 1); G.DrawLine(Draw.GetPen(Color.FromArgb(67, 63, 60)), 1, BarRect.Height - 1, Width - 2, BarRect.Height - 1); Font drawFont = new Font("Arial", 9, FontStyle.Bold); G.DrawString(Text, drawFont, Brushes.White, new Rectangle(15, 3, Width - 1, 26), new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }); e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); G.Dispose(); B.Dispose(); }