DrawingVisual Constructor ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Available since 3.0
Return to top
Show: