--- title: "How to: Create a Composite Drawing" ms.date: "03/30/2017" helpviewer_keywords: - "drawings [WPF], composite" - "composite drawings [WPF]" - "graphics [WPF], composite drawings" ms.assetid: 066eb0ab-5f0e-439d-85c6-dca60af269fc --- # How to: Create a Composite Drawing This example shows how to use a to create complex drawings by combining multiple objects into a single composite drawing. ## Example The following example uses a to create a composite drawing from the and objects. The following illustration shows the output that this example produces. ![A DrawingGroup with multiple drawings](./media/graphicsmm-simple.jpg "graphicsmm_simple") A composite drawing that is created by using DrawingGroup Note the gray border, which shows the bounds of the drawing. [!code-csharp[DrawingMiscSnippets_snip#GraphicsMMSimpleDrawingGroupExample](~/samples/snippets/csharp/VS_Snippets_Wpf/DrawingMiscSnippets_snip/CSharp/DrawingGroupExample.cs#graphicsmmsimpledrawinggroupexample)] [!code-xaml[DrawingMiscSnippets_snip#GraphicsMMSimpleDrawingGroupExample](~/samples/snippets/xaml/VS_Snippets_Wpf/DrawingMiscSnippets_snip/XAML/DrawingGroupExample.xaml#graphicsmmsimpledrawinggroupexample)] You can use a to apply a , setting, , , , or to the drawings it contains. Because a is also a , it can contain other objects. The following example is similar to the preceding example, except that it uses additional objects to apply bitmap effects and an opacity mask to some of its drawings. The following illustration shows the output that this example produces. ![A DrawingGroup with multiple drawings](./media/graphicsmm-multiple.jpg "graphicsmm_multiple") Composite drawing that has multiple DrawingGroup objects Note the gray border, which shows the bounds of the drawing. [!code-csharp[DrawingMiscSnippets_snip#GraphicsMMMultipleDrawingGroupsExample](~/samples/snippets/csharp/VS_Snippets_Wpf/DrawingMiscSnippets_snip/CSharp/DrawingGroupExample.cs#graphicsmmmultipledrawinggroupsexample)] [!code-xaml[DrawingMiscSnippets_snip#GraphicsMMMultipleDrawingGroupsExample](~/samples/snippets/xaml/VS_Snippets_Wpf/DrawingMiscSnippets_snip/XAML/DrawingGroupExample.xaml#graphicsmmmultipledrawinggroupsexample)] For more information about objects, see [Drawing Objects Overview](drawing-objects-overview.md). ## See also - - - - - - - [Drawing Objects Overview](drawing-objects-overview.md)