29.3. WPF Brushes and Pens

Each of the WPF graphical rendering options (shape, drawing and geometries, and visuals) makes extensive use of brushes, which allow you to control how the interior of a 2D surface is filled. WPF provides six different brush types, all of which extend System.Windows.Media.Brush. While Brush is abstract, the descendents described in Table 29-4 can be used to fill a region with just about any conceivable option.

Table 29.4. WPF Brush-Derived Types
Brush TypeMeaning in Life
DrawingBrushPaints an area with a Drawing derived object (GeometryDrawing, ImageDrawing, or VideoDrawing)
ImageBrushPaints an area with an image (represented by an ImageSource object)
LinearGradientBrushPaints an area with a linear gradient
RadialGradientBrush ...

Get Pro C# 2010 and the .NET 4 Platform, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.