Code:
SolidBrush:
SolidBrush b = new SolidBrush(Color.Blue);Or:
Brush b = SystemBrushes.Control;Or:
Brush b = Brushes.Blue;
TextureBrush
TextureBrush b = new TextureBrush(new Bitmap(@"PATH HERE", WrapMode.Tile);
HatchBrush
HatchBrush b = new HatchBrush(HatchStyle.Cross, Color.Black);
LinearGradientBrush b = new LinearGradientBrush(new Point(X1, Y1), new Point(X2, Y2), color1, color2);
PathGradientBrush b = new PathGradientBrush(new [] {new Point(X, Y), new Point(X, Y), ...}) b.CenterPoint = new Point(X, Y); b.CenterColor = Color.Blue; b.SurroundColor = new [] {Color.Red, Color.Black, ....};
Don't forget to add this at the end to fill the form with your brush:
e.Graphics.FillRectangle(b, e.ClipRectangle);
HatchStyles:
All HatchStyles available in C# |