title | description | ms.date | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|
How to: Enumerate Drawing Content of a Visual |
Learn how to enumerate the drawing content of a Visual by using the GetDrawing method to retrieve the DrawingGroup value of a Visual and enumerating it. |
03/30/2017 |
|
2974ddb3-2997-4713-8fd2-e93d549c58a8 |
The xref:System.Windows.Media.Drawing object provide an object model for enumerating the contents of a xref:System.Windows.Media.Visual.
The following example uses the xref:System.Windows.Media.VisualTreeHelper.GetDrawing%2A method to retrieve the xref:System.Windows.Media.DrawingGroup value of a xref:System.Windows.Media.Visual and enumerate it.
Note
When you are enumerating the contents of the visual, you are retrieving xref:System.Windows.Media.Drawing objects, and not the underlying representation of the render data as a vector graphics instruction list. For more information, see WPF Graphics Rendering Overview.
[!code-csharpDrawingMiscSnippets_snip#GraphicsMMRetrieveDrawings]
- xref:System.Windows.Media.Drawing
- xref:System.Windows.Media.DrawingGroup
- xref:System.Windows.Media.VisualTreeHelper
- Drawing Objects Overview
- WPF Graphics Rendering Overview