Stroke.Draw Method (DrawingContext)
.NET Framework 4.5
Renders the Stroke object based upon the specified DrawingContext.
Namespace: System.Windows.Ink
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- context
- Type: System.Windows.Media.DrawingContext
The following example demonstrates how to draw a Stroke object by using a DrawingContext.
protected DrawingVisual DrawDCOnly(Stroke myStroke) { // Create new Visual context to draw on DrawingVisual myVisual = new DrawingVisual(); DrawingContext myContext = myVisual.RenderOpen(); // myMatrix is scaled by: // myMatrix.Scale(0.5, 0.5) myStroke.Transform(myMatrix, false); // Draw the stroke on the Visual context using DrawingContext myStroke.Draw(myContext); // Close the context myContext.Close(); return myVisual; }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.