# GeometryDrawing Pen and Geometry : Geometry « Windows Presentation Foundation « VB.Net

GeometryDrawing Pen and Geometry

```

<Window x:Class="Drawing.Drawings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Drawings" Height="300" Width="300">
<Window.Resources>
<GeometryDrawing x:Key="Drawing" Brush="Yellow" >
<GeometryDrawing.Pen>
<Pen Brush="Blue" Thickness="3"></Pen>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure IsClosed="True" StartPoint="10,100">
<LineSegment Point="100,100" />
<LineSegment Point="100,50" />
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</Window.Resources>

<StackPanel Orientation="Horizontal" Margin="5">
<Button Width="30" Height="30">
<Image>
<Image.Source>
<DrawingImage Drawing="{StaticResource Drawing}">
</DrawingImage>
</Image.Source>
</Image>
</Button>

</StackPanel>
</Window>

```

### Related examples in the same category

 1 GeometryCombineMode = Union 2 GeometryCombineMode = Intersect 3 GeometryCombineMode = Xor 4 GeometryCombineMode = Exclude 5 Combine two circles into one shape using CombinedGeometry: Union 6 Combine two circles into one shape using CombinedGeometry: Xor 7 Combine two circles into one shape using CombinedGeometry: Intersect 8 Combine two circles into one shape using CombinedGeometry: Exclude 9 Combine Geometry 10 LineGeometry for Path 11 EllipseGeometry for Path 12 BezierSegment for a Path 13 Put EllipseGeometry to GeometryGroup 14 Put RectangleGeometry to GeometryGroup 15 Path based on GeometryGroup Resource 16 GeometryDrawing.Brush 17 GeometryDrawing.Pen 18 GeometryDrawing with 2 PathFigures 19 GeometryGroup and DrawingImage 20 GeometryDrawing insize a DrawingGroup 21 Use the StreamGeometry mini-language to create polyline 22 Create a PathGeometry using the PathFigureCollection mini-language. 23 PolyLineSegment creates a series of straight lines. 24 LineGeometry vs Line 25 RectangleGeometry vs Rectangle 26 EllipseGeometry vs Ellipse 27 Combine geometries is to use the GeometryGroup object 28 Geometry Group 29 CombinedGeometry GeometryCombineMode="Union" 30 Reusing Geometry 31 Converting text to geometry 32 Use a PathGeometry object to highlight displayed text.