DrawingVisual Constructor

Initializes a new instance of the DrawingVisual class.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public:
DrawingVisual()

When you create a DrawingVisual object, it has no drawing content. You can add text, graphic, or image content by retrieving the drawing context of the object and drawing into it. A drawing context is returned by calling the RenderOpen method of a DrawingVisual object.

In the following example, a DrawingVisual object is created, and a rectangle is drawn into its drawing context. Notice that you must call the Close method of the DrawingContext to persist drawing content.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft