Applying a DrawingBrush

The DrawingBrush brush enables you to paint an area with a so called drawing. A drawing, according to the MSDN documentation, can be a shape, an image, a video, text, or another item and is an instance of the System.Windows.Media.Drawing class. The following code sample fills a rectangle with a DrawingBrush defining a drawing where two ellipses intersect each other:

<Rectangle Width="100"           Grid.Row="6">    <Rectangle.Fill>        <DrawingBrush>            <DrawingBrush.Drawing>                <GeometryDrawing>                    <GeometryDrawing.Brush>                        <LinearGradientBrush>                            <GradientStop Offset="0" Color="Blue"/>                            <GradientStop ...

Get Visual Basic 2015 Unleashed 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.