Stroke Constructor (StylusPointCollection)
.NET Framework 4.5
Initializes a new instance of the Stroke class.
Namespace: System.Windows.Ink
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- stylusPoints
- Type: System.Windows.Input.StylusPointCollection
A StylusPointCollection that represents the Stroke.
| Exception | Condition |
|---|---|
| ArgumentNullException | stylusPoints is null. |
| ArgumentException | stylusPoints is empty.. |
The following example demonstrates how to create a Stroke from a StylusPointCollection and DrawingAttributes object. This example assumes that there is an InkPresenter called myInkPresenter.
DrawingAttributes drawingAttributes1 = new DrawingAttributes(); drawingAttributes1.Color = Colors.Green; StylusPoint stylusPoint1 = new StylusPoint(100, 100); StylusPoint stylusPoint2 = new StylusPoint(100, 200); StylusPoint stylusPoint3 = new StylusPoint(200, 200); StylusPoint stylusPoint4 = new StylusPoint(200, 100); StylusPoint stylusPoint5 = new StylusPoint(100, 100); StylusPointCollection points = new StylusPointCollection( new StylusPoint[] { stylusPoint1, stylusPoint2, stylusPoint3, stylusPoint4, stylusPoint5 }); Stroke newStroke = new Stroke(points, drawingAttributes1); myInkPresenter.Strokes.Add(newStroke);
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.