modernaesthetics

Studio Theme - C#

Jun 7th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Drawing.Drawing2D;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7.  
  8.  
  9. //------------------
  10. //Creator: aeonhack
  11. //Site: elitevs.net
  12. //Created: 9/23/2011
  13. //Changed: 9/23/2011
  14. //Version: 1.0.0
  15. //Theme Base: 1.5.2
  16. //------------------
  17. class StudioTheme : ThemeContainer152
  18. {
  19.  
  20.  
  21.     private GraphicsPath Path;
  22.     public StudioTheme()
  23.     {
  24.         MoveHeight = 30;
  25.         BackColor = Color.FromArgb(20, 40, 70);
  26.         TransparencyKey = Color.Fuchsia;
  27.  
  28.         SetColor("Sides", 50, 70, 100);
  29.         SetColor("Gradient1", 65, 85, 115);
  30.         SetColor("Gradient2", 50, 70, 100);
  31.         SetColor("Hatch1", 20, 40, 70);
  32.         SetColor("Hatch2", 40, 60, 90);
  33.         SetColor("Shade1", 15, Color.Black);
  34.         SetColor("Shade2", Color.Transparent);
  35.         SetColor("Border1", 12, 32, 62);
  36.         SetColor("Border2", 20, Color.Black);
  37.         SetColor("Border3", 30, Color.White);
  38.         SetColor("Border4", Color.Black);
  39.         SetColor("Text", Color.White);
  40.  
  41.         Path = new GraphicsPath();
  42.     }
  43.  
  44.     private Color C1;
  45.     private Color C2;
  46.     private Color C3;
  47.     private Color C4;
  48.     private Color C5;
  49.     private Pen P1;
  50.     private Pen P2;
  51.     private Pen P3;
  52.     private Pen P4;
  53.     private Pen P5;
  54.     private HatchBrush B1;
  55.  
  56.     private SolidBrush B2;
  57.     protected override void ColorHook()
  58.     {
  59.         P1 = new Pen(TransparencyKey, 3);
  60.         P2 = new Pen(GetColor("Border1"));
  61.         P3 = new Pen(GetColor("Border2"), 2);
  62.         P4 = new Pen(GetColor("Border3"));
  63.         P5 = new Pen(GetColor("Border4"));
  64.  
  65.         C1 = GetColor("Sides");
  66.         C2 = GetColor("Gradient1");
  67.         C3 = GetColor("Gradient2");
  68.         C4 = GetColor("Shade1");
  69.         C5 = GetColor("Shade2");
  70.  
  71.         B1 = new HatchBrush(HatchStyle.LightDownwardDiagonal, GetColor("Hatch1"), GetColor("Hatch2"));
  72.         B2 = new SolidBrush(GetColor("Text"));
  73.  
  74.         BackColor = GetColor("Hatch2");
  75.     }
  76.  
  77.  
  78.     private Rectangle RT1;
  79.     protected override void PaintHook()
  80.     {
  81.         G.DrawRectangle(P1, ClientRectangle);
  82.         G.SetClip(Path);
  83.  
  84.         G.Clear(C1);
  85.         DrawGradient(C2, C3, 0, 0, Width, 30);
  86.  
  87.         RT1 = new Rectangle(12, 30, Width - 24, Height - 12 - 30);
  88.         G.FillRectangle(B1, RT1);
  89.  
  90.         DrawGradient(C4, C5, 12, 30, Width - 24, 30);
  91.  
  92.         DrawBorders(P2, RT1);
  93.         DrawBorders(P3, 14, 32, Width - 26, Height - 12 - 32);
  94.  
  95.         DrawText(B2, HorizontalAlignment.Left, 12, 0);
  96.  
  97.         DrawBorders(P4, 1);
  98.  
  99.         G.ResetClip();
  100.         G.DrawPath(P5, Path);
  101.     }
  102.  
  103.     protected override void OnResize(EventArgs e)
  104.     {
  105.         Path.Reset();
  106.         Path.AddLines(new Point[] {
  107.                         new Point(2, 0),
  108.                         new Point(Width - 3, 0),
  109.                         new Point(Width - 1, 2),
  110.                         new Point(Width - 1, Height - 3),
  111.                         new Point(Width - 3, Height - 1),
  112.                         new Point(2, Height - 1),
  113.                         new Point(0, Height - 3),
  114.                         new Point(0, 2),
  115.                         new Point(2, 0)
  116.                 });
  117.  
  118.         base.OnResize(e);
  119.     }
  120.  
  121. }
  122.  
  123. //------------------
  124. //Creator: aeonhack
  125. //Site: elitevs.net
  126. //Created: 9/23/2011
  127. //Changed: 9/23/2011
  128. //Version: 1.0.0
  129. //Theme Base: 1.5.2
  130. //------------------
  131. class StudioButton : ThemeControl152
  132. {
  133.  
  134.     public StudioButton()
  135.     {
  136.         Transparent = true;
  137.         BackColor = Color.Transparent;
  138.  
  139.         SetColor("DownGradient1", 45, 65, 95);
  140.         SetColor("DownGradient2", 65, 85, 115);
  141.         SetColor("NoneGradient1", 65, 85, 115);
  142.         SetColor("NoneGradient2", 45, 65, 95);
  143.         SetColor("Shine1", 30, Color.White);
  144.         SetColor("Shine2A", 30, Color.White);
  145.         SetColor("Shine2B", Color.Transparent);
  146.         SetColor("Shine3", 20, Color.White);
  147.         SetColor("TextShade", 50, Color.Black);
  148.         SetColor("Text", Color.White);
  149.         SetColor("Glow", 10, Color.White);
  150.         SetColor("Border", 20, 40, 70);
  151.         SetColor("Corners", 20, 40, 70);
  152.     }
  153.  
  154.     private Color C1;
  155.     private Color C2;
  156.     private Color C3;
  157.     private Color C4;
  158.     private Color C5;
  159.     private Color C6;
  160.     private Color C7;
  161.     private Pen P1;
  162.     private Pen P2;
  163.     private Pen P3;
  164.     private SolidBrush B1;
  165.     private SolidBrush B2;
  166.  
  167.     private SolidBrush B3;
  168.     protected override void ColorHook()
  169.     {
  170.         C1 = GetColor("DownGradient1");
  171.         C2 = GetColor("DownGradient2");
  172.         C3 = GetColor("NoneGradient1");
  173.         C4 = GetColor("NoneGradient2");
  174.         C5 = GetColor("Shine2A");
  175.         C6 = GetColor("Shine2B");
  176.         C7 = GetColor("Corners");
  177.  
  178.         P1 = new Pen(GetColor("Shine1"));
  179.         P2 = new Pen(GetColor("Shine3"));
  180.         P3 = new Pen(GetColor("Border"));
  181.  
  182.         B1 = new SolidBrush(GetColor("TextShade"));
  183.         B2 = new SolidBrush(GetColor("Text"));
  184.         B3 = new SolidBrush(GetColor("Glow"));
  185.     }
  186.  
  187.  
  188.     protected override void PaintHook()
  189.     {
  190.         if (State == MouseState.Down)
  191.         {
  192.             DrawGradient(C1, C2, ClientRectangle, 90f);
  193.         }
  194.         else
  195.         {
  196.             DrawGradient(C3, C4, ClientRectangle, 90f);
  197.         }
  198.  
  199.         G.DrawLine(P1, 1, 1, Width, 1);
  200.         DrawGradient(C5, C6, 1, 1, 1, Height);
  201.         DrawGradient(C5, C6, Width - 2, 1, 1, Height);
  202.         G.DrawLine(P2, 1, Height - 2, Width, Height - 2);
  203.  
  204.         if (State == MouseState.Down)
  205.         {
  206.             DrawText(B1, HorizontalAlignment.Center, 2, 2);
  207.             DrawText(B2, HorizontalAlignment.Center, 1, 1);
  208.         }
  209.         else
  210.         {
  211.             DrawText(B1, HorizontalAlignment.Center, 1, 1);
  212.             DrawText(B2, HorizontalAlignment.Center, 0, 0);
  213.         }
  214.  
  215.         if (State == MouseState.Over)
  216.         {
  217.             G.FillRectangle(B3, ClientRectangle);
  218.         }
  219.  
  220.         DrawBorders(P3);
  221.         DrawCorners(C7, 1, 1, Width - 2, Height - 2);
  222.  
  223.         DrawCorners(BackColor);
  224.     }
  225. }
Advertisement
Add Comment
Please, Sign In to add comment