--- title: "How to: Create a Composite Shape" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "shapes [WPF], composite" - "composite shapes [WPF]" - "graphics [WPF], composite shapes" ms.assetid: 8e5c7ef4-d7ed-4c43-afc9-ca01325c300b --- # How to: Create a Composite Shape This example shows how to create composite shapes using objects and display them using a element. In the following example, a , , and a are used with a to create a composite shape. The geometries are then drawn using a element. ## Example [!code-xaml[GeometrySample#19](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometrySample/CS/combininggeometriesexample.xaml#19)] [!code-csharp[GeometriesMiscSnippets_procedural_snip#CompositeShapeCodeExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_procedural_snip/CSharp/CompositeShapeExample.cs#compositeshapecodeexampleinline1)] [!code-vb[GeometriesMiscSnippets_procedural_snip#CompositeShapeCodeExampleInline1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_procedural_snip/visualbasic/compositeshapeexample.vb#compositeshapecodeexampleinline1)] The following illustration shows the shape created in the previous example. ![A composite geometry created using a GeometryGroup](./media/wcpsdk-graphicsmm-compositegeometryexample1.jpg "wcpsdk_graphicsmm_compositegeometryexample1") Composite Geometry More complex shapes, such as polygons and shapes with curved segments, may be created using a . For an example showing how to create a shape using a , see [Create a Shape by Using a PathGeometry](how-to-create-a-shape-by-using-a-pathgeometry.md). Although this example renders a shape to the screen using a element, objects may also be used to describe the contents of a or a . They may also be used for clipping and hit-testing. This example is part of larger sample; for the complete sample, see the [Geometries Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Graphics/Geometry).