void SkyBase_PaintHook(System.Windows.Forms.PaintEventArgs e) { SkyBase_T1 = new Rectangle(1, 1, Width - 3, 18); Bitmap SkyBase_B = new Bitmap(Width, Height); G = Graphics.FromImage(SkyBase_B); //Drawing G.Clear(SkyBase_C1); LinearGradientBrush SkyBase_G1 = new LinearGradientBrush(new Point(SkyBase_T1.X, SkyBase_T1.Y), new Point(SkyBase_T1.X, SkyBase_T1.Y + SkyBase_T1.Height), SkyBase_C3, SkyBase_C4); G.FillRectangle(SkyBase_G1, SkyBase_T1); G.DrawRectangle(ConversionFunctions.ToPen(SkyBase_C2), SkyBase_T1); G.DrawRectangle(ConversionFunctions.ToPen(SkyBase_C2), new Rectangle(SkyBase_T1.X, SkyBase_T1.Y + SkyBase_T1.Height + 2, SkyBase_T1.Width, Height - SkyBase_T1.Y - SkyBase_T1.Height - 4)); SkyBase_G1.Dispose(); G.DrawString(Text, Font, ConversionFunctions.ToBrush(113, 170, 186), new Rectangle(new Point(SkyBase_T1.X + 4, SkyBase_T1.Y), new Size(SkyBase_T1.Width - 40, SkyBase_T1.Height)), new StringFormat { LineAlignment = StringAlignment.Center }); //Finish Up e.Graphics.DrawImage((Bitmap)SkyBase_B.Clone(), 0, 0); //G.Dispose(); SkyBase_B.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Graphics G = e.Graphics; G.Clear(Color.FromArgb(246, 246, 246)); G.DrawRectangle(ConversionFunctions.ToPen(150, 150, 150), new Rectangle(0, Convert.ToInt32(G.MeasureString(Text, Font).Height / 2), Width - 1, Height - 1 - Convert.ToInt32(G.MeasureString(Text, Font).Height / 2))); int TOff = 0; switch (TA) { case TAlign.Left: TOff = 6; break; case TAlign.Right: TOff = Width - 6 - (int)G.MeasureString(Text, Font).Width; break; case TAlign.Center: TOff = Convert.ToInt32((Width / 2) - (G.MeasureString(Text, Font).Width / 2)); break; } G.FillRectangle(ConversionFunctions.ToBrush(246, 246, 246), new Rectangle(new Point(TOff, 0), G.MeasureString(Text, Font).ToSize())); G.DrawString(Text, Font, Brushes.Black, TOff, 0); }
protected override void OnPaint(PaintEventArgs e) { if (!(DropDownStyle == ComboBoxStyle.DropDownList)) { DropDownStyle = ComboBoxStyle.DropDownList; } base.OnPaint(e); Graphics G = e.Graphics; LinearGradientBrush T = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(0, Color.Black), Color.FromArgb(22, Color.Black), 90); SolidBrush DrawCornersBrush = new SolidBrush(Color.FromArgb(20, 20, 20)); DrawCornersBrush = (SolidBrush)ConversionFunctions.ToBrush(20, 20, 20); try { var _with1 = G; G.SmoothingMode = SmoothingMode.HighQuality; _with1.Clear(Color.FromArgb(20, 20, 20)); _with1.FillRectangle(T, new Rectangle(0, 0, Width, Height)); _with1.DrawLine(ConversionFunctions.ToPen(20, 20, 20), 0, 0, 0, 0); _with1.DrawRectangle(ConversionFunctions.ToPen(70, 70, 70), new Rectangle(1, 1, Width - 3, Height - 3)); _with1.DrawLine(ConversionFunctions.ToPen(80, Color.White), new Point(Width - 22, 4), new Point(Width - 22, Height - 5)); GraphicsPath K = new GraphicsPath(); K.AddEllipse(-Width / 2, -Height, Width * 2, Convert.ToInt32(Height * 1.55)); PathGradientBrush kK = new PathGradientBrush(K); kK.CenterColor = Color.Transparent; kK.SurroundColors = new Color[] { Color.FromArgb(30, Color.DimGray) }; _with1.FillPath(kK, K); try { if (_with1.MeasureString(Text, Font).Width > Width - 29) { _with1.DrawString(Items[SelectedIndex].ToString(), Font, ConversionFunctions.ToBrush(71, 71, 71), new RectangleF(3, 3, Width - 35, Height - 7)); _with1.DrawString("...", Font, ConversionFunctions.ToBrush(230, 230, 230), new Point(Width - 38, 3)); } else { _with1.DrawString(Items[SelectedIndex].ToString(), Font, ConversionFunctions.ToBrush(71, 71, 71), new RectangleF(3, 3, Width - 35, Height - 7)); } } catch { _with1.DrawString("...", Font, ConversionFunctions.ToBrush(230, 230, 230), new Point(3, 3)); } DrawTriangle(Color.FromArgb(230, 230, 230), new Point(Width - 15, Height - 10), new Point(Width - 12, Height - 7), new Point(Width - 9, Height - 10), G); DrawTriangle(Color.FromArgb(60, 60, 60), new Point(Width - 15, Height - 12), new Point(Width - 12, Height - 8), new Point(Width - 9, Height - 12), G); DrawTriangle(Color.FromArgb(230, 230, 230), new Point(Width - 15, 9), new Point(Width - 12, 6), new Point(Width - 9, 9), G); DrawTriangle(Color.FromArgb(60, 60, 60), new Point(Width - 15, 11), new Point(Width - 12, 7), new Point(Width - 9, 11), G); _with1.DrawPath(ConversionFunctions.ToPen(120, Color.Black), RRM.RoundRect(0, 0, Width - 1, Height - 1, 2)); } catch { } }
protected override void OnPaint(PaintEventArgs e) { Bitmap image = new Bitmap(base.Width - 5, base.Height - 5); Graphics graphics = Graphics.FromImage(image); graphics.Clear(base.Parent.BackColor); this.C3 = Color.FromArgb(70, 0x45, 0x44); this.C4 = Color.FromArgb(0x40, 60, 0x3b); switch (base.Enabled) { case false: this.C5 = Color.FromArgb(0x58, 0x58, 0x58); break; case true: switch (this.State) { case MouseState.None: this.C5 = Color.FromArgb(0x97, 0xb5, 190); break; case MouseState.Down: this.C5 = Color.FromArgb(0x79, 0x97, 160); this.C3 = Color.FromArgb(0x40, 60, 0x3b); this.C4 = Color.FromArgb(70, 0x45, 0x44); break; } break; } Rectangle rect = new Rectangle(0, 0, base.Height - 6, base.Height - 6); LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), this.C3, this.C4); graphics.FillRectangle(brush, rect); brush.Dispose(); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), rect); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2)); Rectangle rectangle2 = new Rectangle(rect.X + (rect.Width / 4), rect.Y + (rect.Height / 4), rect.Width / 2, rect.Height / 2); Point[] pointArray = new Point[] { new Point(rectangle2.X, rectangle2.Y + (rectangle2.Height / 2)), new Point(rectangle2.X + (rectangle2.Width / 2), rectangle2.Y + rectangle2.Height), new Point(rectangle2.X + rectangle2.Width, rectangle2.Y) }; if (this.Checked) { graphics.SmoothingMode = SmoothingMode.HighQuality; Pen pen = new Pen(ConversionFunctions.ToBrush(this.C5), 2f); for (int i = 0; i <= (pointArray.Length - 2); i++) { graphics.DrawLine(pen, pointArray[i], pointArray[i + 1]); } } StringFormat format = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Near }; graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(this.C5), new Rectangle((rect.X + rect.Width) + 5, 0, ((base.Width - rect.X) - rect.Width) - 5, base.Height), format); e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { Bitmap image = new Bitmap(base.Width, base.Height); Graphics graphics = Graphics.FromImage(image); Rectangle rect = new Rectangle(3, 3, Convert.ToInt32((int)((base.Width - 7) * this.val / this.max)), base.Height - 7); graphics.Clear(this.C5); LinearGradientBrush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4); graphics.FillRectangle(brush, rect); brush.Dispose(); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), rect); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), 0, 0, base.Width - 1, base.Height - 1); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 1, 1, base.Width - 3, base.Height - 3); e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { Bitmap image = new Bitmap(base.Width, base.Height); Graphics graphics = Graphics.FromImage(image); LinearGradientBrush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4); graphics.FillRectangle(brush, 0, 0, base.Width, base.Height); brush.Dispose(); if (base.Enabled) { switch (this.State) { case MouseState.Over: graphics.FillRectangle(new SolidBrush(Color.FromArgb(20, Color.White)), new Rectangle(0, 0, base.Width, base.Height)); break; case MouseState.Down: graphics.FillRectangle(new SolidBrush(Color.FromArgb(10, Color.Black)), new Rectangle(0, 0, base.Width, base.Height)); break; } } StringFormat format = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }; switch (base.Enabled) { case false: graphics.DrawString(this.Text, this.Font, Brushes.Gray, new Rectangle(0, 0, base.Width - 1, base.Height - 1), format); break; case true: graphics.DrawString(this.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(0, 0, base.Width - 1, base.Height - 1), format); break; } format.Dispose(); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), 0, 0, base.Width - 1, base.Height - 1); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 1, 1, base.Width - 3, base.Height - 3); e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { Bitmap image = new Bitmap(base.Width, base.Height); Graphics graphics = Graphics.FromImage(image); switch (this.Align) { case Alignment.Vertical: graphics.DrawLine(ConversionFunctions.ToPen(this.C1), new Point(base.Width / 2, 0), new Point(base.Width / 2, base.Height)); graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point((base.Width / 2) + 1, 0), new Point((base.Width / 2) + 1, base.Height)); break; case Alignment.Horizontal: graphics.DrawLine(ConversionFunctions.ToPen(this.C1), new Point(0, base.Height / 2), new Point(base.Width, base.Height / 2)); graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(0, (base.Height / 2) + 1), new Point(base.Width, (base.Height / 2) + 1)); break; } e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12); Bitmap image = new Bitmap(base.Width, base.Height); Graphics graphics = Graphics.FromImage(image); graphics.Clear(this.C1); LinearGradientBrush brush = new LinearGradientBrush(new Point(this.T1.X, this.T1.Y), new Point(this.T1.X, this.T1.Y + this.T1.Height), this.C3, this.C4); graphics.FillRectangle(brush, this.T1); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), this.T1); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(this.T1.X, (this.T1.Y + this.T1.Height) + 2, this.T1.Width, ((base.Height - this.T1.Y) - this.T1.Height) - 4)); brush.Dispose(); StringFormat format = new StringFormat { LineAlignment = StringAlignment.Center }; graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(new Point(this.T1.X + 4, this.T1.Y), new Size(this.T1.Width - 40, this.T1.Height)), format); e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Bitmap B = new Bitmap(Width, Height); Graphics G = Graphics.FromImage(B); switch (Align) { case Alignment.Vertical: G.DrawLine(ConversionFunctions.ToPen(C1), new Point(Width / 2, 0), new Point(Width / 2, Height)); G.DrawLine(ConversionFunctions.ToPen(C2), new Point(Width / 2 + 1, 0), new Point(Width / 2 + 1, Height)); break; case Alignment.Horizontal: G.DrawLine(ConversionFunctions.ToPen(C1), new Point(0, Height / 2), new Point(Width, Height / 2)); G.DrawLine(ConversionFunctions.ToPen(C2), new Point(0, Height / 2 + 1), new Point(Width, Height / 2 + 1)); break; } e.Graphics.DrawImage(B, 0, 0); G.Dispose(); B.Dispose(); }
protected override void OnPaint(PaintEventArgs e) { Bitmap image = new Bitmap(base.Width, base.Height); Graphics graphics = Graphics.FromImage(image); try { base.SelectedTab.BackColor = this.C1; } catch { } graphics.Clear(base.Parent.BackColor); for (int i = 0; i <= (base.TabCount - 1); i++) { if (i == base.SelectedIndex) { continue; } Rectangle rect = new Rectangle(base.GetTabRect(i).X, base.GetTabRect(i).Y + 3, base.GetTabRect(i).Width + 2, base.GetTabRect(i).Height); LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), Color.FromArgb(60, 0x3b, 0x3a), Color.FromArgb(0x45, 0x45, 70)); graphics.FillRectangle(brush, rect); brush.Dispose(); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), rect); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height)); string s = string.Empty; switch (i) { case 0: s = "Main"; break; case 1: s = "Extra"; break; case 2: s = "Scan"; break; case 3: s = "Info"; break; } StringFormat format = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }; graphics.DrawString(s, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), rect, format); } graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), 0, base.ItemSize.Height, base.Width, base.Height); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 0, base.ItemSize.Height, base.Width - 1, (base.Height - base.ItemSize.Height) - 1); graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), 1, base.ItemSize.Height + 1, base.Width - 3, (base.Height - base.ItemSize.Height) - 3); if (base.SelectedIndex != -1) { string str2 = string.Empty; if (base.SelectedIndex == 0) { str2 = "Main"; } else if (base.SelectedIndex == 1) { str2 = "Extra"; } else if (base.SelectedIndex == 2) { str2 = "Scan"; } else if (base.SelectedIndex == 3) { str2 = "Info"; } Rectangle layoutRectangle = new Rectangle(base.GetTabRect(base.SelectedIndex).X - 2, base.GetTabRect(base.SelectedIndex).Y, base.GetTabRect(base.SelectedIndex).Width + 3, base.GetTabRect(base.SelectedIndex).Height); graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), new Rectangle(layoutRectangle.X + 2, layoutRectangle.Y + 2, layoutRectangle.Width - 2, layoutRectangle.Height)); graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, (layoutRectangle.Y + layoutRectangle.Height) - 2), new Point(layoutRectangle.X, layoutRectangle.Y)); graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y)); graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, (layoutRectangle.Y + layoutRectangle.Height) - 2)); graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, (layoutRectangle.Y + layoutRectangle.Height) - 1), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1)); graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1)); graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, (layoutRectangle.Y + layoutRectangle.Height) - 1)); StringFormat format2 = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }; graphics.DrawString(str2, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), layoutRectangle, format2); } e.Graphics.DrawImage(image, 0, 0); graphics.Dispose(); image.Dispose(); }