Advertisement
Guest User

AeonHack's Draw class converted by Chuiby

a guest
Apr 25th, 2011
3,430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. public class Draw
  2. {
  3.     public static void Gradient(Graphics g, Color c1, Color c2, int x, int y, int width, int height)
  4.     {
  5.         Rectangle R = new Rectangle(x, y, width, height);
  6.         using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical))
  7.         {
  8.             g.FillRectangle(T, R);
  9.         }
  10.     }
  11.     public static void Blend(Graphics g, Color c1, Color c2, Color c3, float c, int d, int x, int y, int width, int height)
  12.     {
  13.         ColorBlend V = new ColorBlend(3);
  14.         V.Colors = new Color[] {c1, c2, c3};
  15.         V.Positions = new float[] {0F, c, 1F};
  16.         Rectangle R = new Rectangle(x, y, width, height);
  17.         using (LinearGradientBrush T = new LinearGradientBrush(R, c1, c1, (LinearGradientMode)d))
  18.         {
  19.             T.InterpolationColors = V;
  20.             g.FillRectangle(T, R);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement