Advertisement
Astekk

flow theme c#

Dec 3rd, 2014
1,057
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 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 FlowTheme : ThemeContainer152
  18. {
  19.  
  20. public FlowTheme()
  21. {
  22. MoveHeight = 24;
  23. BackColor = Color.FromArgb(35, 35, 35);
  24. TransparencyKey = Color.Fuchsia;
  25.  
  26. SetColor("Sides", 40, 40, 40);
  27. SetColor("Gradient", 18, 18, 18);
  28. SetColor("Text", 0, 132, 255);
  29. SetColor("Border1", 40, 40, 40);
  30. SetColor("Border2", 22, 22, 22);
  31. SetColor("Border3", 65, 65, 65);
  32. SetColor("Border4", Color.Black);
  33. SetColor("Hatch1", 39, 39, 39);
  34. SetColor("Hatch2", 35, 35, 35);
  35. SetColor("Hatch3", 29, 29, 29);
  36. SetColor("Hatch4", 26, 26, 26);
  37. SetColor("Shade1", 50, 7, 7, 7);
  38. SetColor("Shade2", Color.Transparent);
  39. }
  40.  
  41. private Color C1;
  42. private Color C2;
  43. private SolidBrush B1;
  44. private Pen P1;
  45. private Pen P2;
  46. private Pen P3;
  47.  
  48. private Pen P4;
  49. protected override void ColorHook()
  50. {
  51. C1 = GetColor("Sides");
  52. C2 = GetColor("Gradient");
  53.  
  54. B1 = new SolidBrush(GetColor("Text"));
  55.  
  56. P1 = new Pen(GetColor("Border1"));
  57. P2 = new Pen(GetColor("Border2"));
  58. P3 = new Pen(GetColor("Border3"));
  59. P4 = new Pen(GetColor("Border4"));
  60.  
  61. CreateTile();
  62. CreateShade();
  63.  
  64. BackColor = GetColor("Hatch2");
  65. }
  66.  
  67.  
  68. private Rectangle RT1;
  69. protected override void PaintHook()
  70. {
  71. G.Clear(C1);
  72.  
  73. DrawGradient(C2, C1, 0, 0, Width, 24);
  74. DrawText(B1, HorizontalAlignment.Left, 8, 0);
  75.  
  76. RT1 = new Rectangle(8, 24, Width - 16, Height - 32);
  77. G.FillRectangle(Tile, RT1);
  78.  
  79. for (int I = 0; I <= Shade.Length - 1; I++)
  80. {
  81. DrawBorders(Shade[I], RT1, I);
  82. }
  83.  
  84. RT1 = new Rectangle(8, 24, Width - 16, Height - 32);
  85. DrawBorders(P1, RT1, 1);
  86. DrawBorders(P2, RT1);
  87. DrawCorners(C1, RT1);
  88.  
  89. DrawBorders(P3, 1);
  90. DrawBorders(P4);
  91.  
  92. DrawCorners(TransparencyKey);
  93. }
  94.  
  95.  
  96. private TextureBrush Tile;
  97. private byte[] TileData = Convert.FromBase64String("AgIBAQEBAwMBAQEBAAABAQEBAQEBAgIBAQEBAwMBAQEBAAAB");
  98. private void CreateTile()
  99. {
  100. Bitmap TileImage = new Bitmap(6, 6);
  101. Color[] TileColors = new Color[] {
  102. GetColor("Hatch1"),
  103. GetColor("Hatch2"),
  104. GetColor("Hatch3"),
  105. GetColor("Hatch4")
  106. };
  107.  
  108. for (int I = 0; I <= 35; I++)
  109. {
  110. TileImage.SetPixel(I % 6, I / 6, TileColors[TileData[I]]);
  111. }
  112.  
  113. Tile = new TextureBrush(TileImage);
  114. TileImage.Dispose();
  115. }
  116.  
  117. private Pen[] Shade;
  118. private void CreateShade()
  119. {
  120. if (Shade != null)
  121. {
  122. for (int I = 0; I <= Shade.Length - 1; I++)
  123. {
  124. Shade[I].Dispose();
  125. }
  126. }
  127.  
  128. Bitmap ShadeImage = new Bitmap(1, 20);
  129. Graphics ShadeGraphics = Graphics.FromImage(ShadeImage);
  130.  
  131. Rectangle ShadeBounds = new Rectangle(0, 0, 1, 20);
  132. LinearGradientBrush Gradient = new LinearGradientBrush(ShadeBounds, GetColor("Shade1"), GetColor("Shade2"), 90f);
  133.  
  134. Shade = new Pen[20];
  135. ShadeGraphics.FillRectangle(Gradient, ShadeBounds);
  136.  
  137. for (int I = 0; I <= Shade.Length - 1; I++)
  138. {
  139. Shade[I] = new Pen(ShadeImage.GetPixel(0, I));
  140. }
  141.  
  142. Gradient.Dispose();
  143. ShadeGraphics.Dispose();
  144. ShadeImage.Dispose();
  145. }
  146.  
  147. }
  148.  
  149. //------------------
  150. //Creator: aeonhack
  151. //Site: elitevs.net
  152. //Created: 9/23/2011
  153. //Changed: 9/23/2011
  154. //Version: 1.0.0
  155. //Theme Base: 1.5.2
  156. //------------------
  157. class FlowButton : ThemeControl152
  158. {
  159.  
  160. public FlowButton()
  161. {
  162. SetColor("DownGradient1", 24, 24, 24);
  163. SetColor("DownGradient2", 38, 38, 38);
  164. SetColor("NoneGradient1", 38, 38, 38);
  165. SetColor("NoneGradient2", 24, 24, 24);
  166. SetColor("Text", 0, 132, 255);
  167. SetColor("Border1", 22, 22, 22);
  168. SetColor("Border2A", 60, 60, 60);
  169. SetColor("Border2B", 36, 36, 36);
  170. }
  171.  
  172. private Color C1;
  173. private Color C2;
  174. private Color C3;
  175. private Color C4;
  176. private Color C5;
  177. private Color C6;
  178. private SolidBrush B1;
  179. private LinearGradientBrush B2;
  180. private Pen P1;
  181.  
  182. private Pen P2;
  183. protected override void ColorHook()
  184. {
  185. C1 = GetColor("DownGradient1");
  186. C2 = GetColor("DownGradient2");
  187. C3 = GetColor("NoneGradient1");
  188. C4 = GetColor("NoneGradient2");
  189. C5 = GetColor("Border2A");
  190. C6 = GetColor("Border2B");
  191.  
  192. B1 = new SolidBrush(GetColor("Text"));
  193.  
  194. P1 = new Pen(GetColor("Border1"));
  195. }
  196.  
  197. protected override void PaintHook()
  198. {
  199. if (State == MouseState.Down)
  200. {
  201. DrawGradient(C1, C2, ClientRectangle, 90f);
  202. }
  203. else
  204. {
  205. DrawGradient(C3, C4, ClientRectangle, 90f);
  206. }
  207.  
  208. DrawText(B1, HorizontalAlignment.Center, 0, 0);
  209.  
  210. B2 = new LinearGradientBrush(ClientRectangle, C5, C6, 90f);
  211. P2 = new Pen(B2);
  212.  
  213. DrawBorders(P1);
  214. DrawBorders(P2, 1);
  215. }
  216. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement