August 2003
Intermediate to advanced
736 pages
14h 48m
English
The System.Drawing.Brush class serves as a base class for several kinds of brushes, depending on your needs. Figure 4.3 shows the five derived brush classes provided in the System.Drawing and System.Drawing.Drawing2D namespaces.

Figure 4.3 was created with the following code:
void BrushesForm_Paint(object sender, PaintEventArgs e) {
Graphics g = e.Graphics;
int x = 0;
int y = 0;
int width = this.ClientRectangle.Width;
int height = this.ClientRectangle.Height/5;
Brush whiteBrush = System.Drawing.Brushes.White;
Brush blackBrush = System.Drawing.Brushes.Black;
using( Brush brush = new SolidBrush(Color.DarkBlue) ...Read now
Unlock full access