daily pastebin goal
50%
SHARE
TWEET

C# Gradients

a guest Mar 13th, 2012 33 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1.         void pbHeaderBar_Paint(object sender, PaintEventArgs e)
  2.         {
  3.             /*
  4.             LinearGradientBrush gradientBrush =
  5.                 new LinearGradientBrush(new Point(0, 0), new Point(0, pbHeaderBar.Height), Color.Black, Color.Black);
  6.  
  7.             ColorBlend colorBlend = new ColorBlend();
  8.             colorBlend.Positions = new float[] { 0, 1/3f, 2/3f, 1 };
  9.             colorBlend.Colors = new Color[] { Color.Blue, Color.Green, Color.Red, Color.Blue };
  10.             gradientBrush.InterpolationColors = colorBlend;
  11.  
  12.             e.Graphics.FillRectangle(gradientBrush, 0, 0, pbHeaderBar.Width, pbHeaderBar.Height);
  13.             */
  14.  
  15.             /*
  16.             Brush gradientBrush = new LinearGradientBrush(new Point(0, 0), new Point(0, pbHeaderBar.Height), Color.Black, Color.Blue);
  17.             e.Graphics.FillRectangle(gradientBrush, 0, 0, pbHeaderBar.Width, pbHeaderBar.Height);
  18.             */
  19.  
  20.             /*
  21.             GraphicsPath gradientPath = new GraphicsPath();
  22.             gradientPath.AddRectangle(new Rectangle(pbHeaderBar.Location, pbHeaderBar.Size));
  23.             PathGradientBrush pathGradientBrush = new PathGradientBrush(gradientPath);
  24.             pathGradientBrush.CenterColor = Color.Green;
  25.             pathGradientBrush.SurroundColors = new[] { Color.Blue };
  26.             e.Graphics.FillRectangle(pathGradientBrush, 0, 0, pbHeaderBar.Width, pbHeaderBar.Height);
  27.             */
  28.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top